Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XMLBeautifier uses wrong line separator
XMLBeautifier uses wrong line separator [message #894043] Fri, 06 July 2012 13:27 Go to next message
Frank Felfe is currently offline Frank FelfeFriend
Messages: 6
Registered: December 2010
Junior Member
Hello there,
I'm testing an upgrade from xtext 2.2. to xtext 2.3. and found a problem with the org.eclipse.xtend.typesystem.xsd.XMLBeautifier which in 2.3 inserts the string '
' in every line wrap.
Debugging revealed that the org.eclipse.xtend.typesystem.xsd.XMLMixedContentFormatter now uses the system property line.separator which is \n\r instead of \n which was hard coded in version 2.2.

Is there something I can do about it? I assume I cannot change the system property.

Greetings and Thanks
Frank
Re: XMLBeautifier uses wrong line separator [message #894060 is a reply to message #894043] Fri, 06 July 2012 14:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
What about setting the property explicitly (something like
-Dline.separator= or subclassing the beautifier and workflow? Btw
what is the problem with the windows line separator

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XMLBeautifier uses wrong line separator [message #894061 is a reply to message #894060] Fri, 06 July 2012 14:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Sorry meant beautifier and workflow

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XMLBeautifier uses wrong line separator [message #894078 is a reply to message #894060] Fri, 06 July 2012 14:39 Go to previous message
Frank Felfe is currently offline Frank FelfeFriend
Messages: 6
Registered: December 2010
Junior Member
The problem with the windows line separator is that the beautifier produces invalid xml files which cannot be parsed e.g. by spring. An example of the xml output is added below.
I don't understand why there are these extra characters. The beautifier seems to convert the \r to 
 and outputs this instead of the control character.
One would expect the beautifier to works out of the box. To me it looks broken.

Here is an example of the beautifier output with wrong characters marked red:

<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns:xsi="someSchemaLink" xmlns="someSchemaLink"
xsi:schemaLocation="someSchemaLink">&#xD;
<bean class="myBeanClass"
id="myBeanId"/>&#xD;
</beans>&#xD;
Previous Topic:IJvmModelInferrer and Generation of Java files outside of Eclipse model project
Next Topic:Why terminal do not generate content assist ?
Goto Forum:
  


Current Time: Fri Apr 19 23:15:21 GMT 2024

Powered by FUDForum. Page generated in 0.03069 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top