| Summary: | XMLMixedContentFormatter must use system line separator | ||
|---|---|---|---|
| Product: | [Modeling] M2T | Reporter: | Karsten Thoms <karsten.thoms> |
| Component: | Xpand | Assignee: | Karsten Thoms <karsten.thoms> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow |
| Version: | 1.1.0 | Flags: | karsten.thoms:
kepler+
|
| Target Milestone: | M4 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 400672 | ||
Fixed The formatter now produces character sequences like 
 on windows boxes. 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.
changeset: 4e95d7b066cc528acf198069a860be8935f8e8b9 Requested via bug 522520. -M. Requested via bug 522520. -M. |
In class XMLMixedContentFormatter line breaks are introduced by using "\n". Instead, the system's line seperator System.getProperty("line.separator") must be used.