Skip to main content



      Home
Home » Modeling » TMF (Xtext) » XMLBeautifier uses wrong line separator
XMLBeautifier uses wrong line separator [message #894043] Fri, 06 July 2012 09:27 Go to next message
Eclipse UserFriend
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 10:07 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: XMLBeautifier uses wrong line separator [message #894061 is a reply to message #894060] Fri, 06 July 2012 10:09 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: XMLBeautifier uses wrong line separator [message #894078 is a reply to message #894060] Fri, 06 July 2012 10:39 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 12:52:07 EDT 2025

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

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

Back to the top