Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319822 - '\b' and '\f' chars are not supported
Summary: '\b' and '\f' chars are not supported
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-14 05:54 EDT by Adolfo Sanchez-Barbudo Herrera CLA
Modified: 2017-09-19 15:54 EDT (History)
4 users (show)

See Also:
sebastian.zarnekow: helios+


Attachments
Patch to set XMI verison to 1.1 (2.79 KB, patch)
2010-08-05 06:18 EDT, Jan Koehnlein CLA
jan: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.