Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319822

Summary: '\b' and '\f' chars are not supported
Product: [Modeling] TMF Reporter: Adolfo Sanchez-Barbudo Herrera <adolfosbh>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, moritz.eysholdt, sebastian.zarnekow, tmf.xtext-inbox
Version: 1.0.0Flags: sebastian.zarnekow: helios+
Target Milestone: SR1   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Patch to set XMI verison to 1.1 jan: review+

Description Adolfo Sanchez-Barbudo Herrera CLA 2010-07-14 05:54:46 EDT
If I introduce the characters '\b' and/or '\f' in the definition of a terminal, the generator provokes an exception while trying the Language.xmi file:

4897 [main] ERROR enerator.CompositeGeneratorFragment  - An invalid XML character (Unicode: 0x8) was found in the element content:
java.lang.RuntimeException: An invalid XML character (Unicode: 0x8) was found in the element content: 

P.S: there is no 1.0.0 version to choose, so unspecified.

Cheers,
Adolfo.
Comment 1 Jan Koehnlein CLA 2010-08-05 06:18:18 EDT
Created attachment 175918 [details]
Patch to set XMI verison to 1.1

That's an XML problem: According to some posts in the EMF newsgroup, XML 1.0 does not allow these characters. 

The easiest way to fix this is to save the grammar's XMI in XML 1.1. Nothing has to be done on the loading side, as the XML version is parsed from the file on load. 

The proposed patch will change the XMI when regenerating any language, so I am not quite sure if this is considered a breaking change. Please review
Comment 2 Sebastian Zarnekow CLA 2010-08-05 07:35:38 EDT
Looks good to me and I won't consider this to be a breaking change since existing languages that worked will still work without the need for regeneration.
Comment 3 Jan Koehnlein CLA 2010-08-05 08:15:15 EDT
Patch applied
Comment 4 Moritz Eysholdt CLA 2010-08-12 05:02:52 EDT
For the record:
When using Linux/Sun-JDK-1.6.0_17, reading in XML-1.1 files leads to bogus data. The actual cause and if other versions of the JDK/Xerces are affected remains unclear. However, current versions of the JDK under Windows and OS X seem not to be affected.

Workaround: In the GrammarAccessFragment int can be specified explicitly to write XML in version 1.0
Comment 5 Karsten Thoms CLA 2017-09-19 15:54:33 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.