Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356576 - XMLMixedContentFormatter must use system line separator
Summary: XMLMixedContentFormatter must use system line separator
Status: CLOSED FIXED
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: 1.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: M4   Edit
Assignee: Karsten Thoms CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 400672
  Show dependency tree
 
Reported: 2011-09-02 08:15 EDT by Karsten Thoms CLA
Modified: 2017-10-31 10:59 EDT (History)
1 user (show)

See Also:
karsten.thoms: kepler+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2011-09-02 08:15:10 EDT
In class XMLMixedContentFormatter line breaks are introduced by using "\n". Instead, the system's line seperator System.getProperty("line.separator") must be used.
Comment 1 Karsten Thoms CLA 2011-09-02 08:18:04 EDT
Fixed
Comment 2 Sebastian Zarnekow CLA 2012-10-10 04:46:21 EDT
The formatter now produces character sequences like 
 on windows boxes.
Comment 3 Karsten Thoms CLA 2012-11-28 10:31:23 EST
The main problem was that character escaping is on by default. Therefore default save option was added.
  opt.put(XMLResource.OPTION_SKIP_ESCAPE, Boolean.TRUE);

Note that this save option can already added by configuration to work around the issue. XMLBeautifier offers the method addSaveOption(OptionsEntry).

In MWE1 you would configure it like follows:
...
  <postprocessor class="org.eclipse.xtend.typesystem.xsd.XMLBeautifier">
    <saveOption class="org.eclipse.xtend.typesystem.xsd.OptionsEntry" key="SKIP_ESCAPE" value="true"/>
  </postprocessor>

However, the line separation can now be influenced by XMLBeautifier#setLineSeparator(String). By default, UNIX style will be used. Other options are WINDOWS and SYSTEM.

Added test case XMLBeautifierTest.
Comment 4 Karsten Thoms CLA 2012-11-29 16:00:10 EST
changeset: 4e95d7b066cc528acf198069a860be8935f8e8b9
Comment 5 Eclipse Webmaster CLA 2017-10-31 10:48:56 EDT
Requested via bug 522520.

-M.
Comment 6 Eclipse Webmaster CLA 2017-10-31 10:59:59 EDT
Requested via bug 522520.

-M.