XML code formatter adds whitespace within elements per default [message #520891] |
Mon, 15 March 2010 12:41  |
Eclipse User |
|
|
|
Hi,
I have the following problem with the XML formatter:
In my XML file, I have one line
<description>MyDesc_Name</description>
Everything works fine. In the debugger, I can see my corresponding EObject holds the value
"MyDesc_Name".
But when I use the Eclipse XML formatter, this part of the XML changes to:
<description>MyDesc_Name
</description>
Then in the debugger, I can see my EObject holds then
"MyDesc_Name\n\t\t"
This causes then several errors lateron.
The formatter doesn't know of the schema for this file, so I would expect a defensive formatting strategy as default.
Unfortunately I couldn't find any setting for this in
preferences->XML->XML Files->Editor.
How to tell the code formatter that it shouldn't add whitespace within elements per default (default means if there is no schema available which tells whether an element is of type string or normalizedString)?
Best regards,
Jens
|
|
|
|
Re: XML code formatter adds whitespace within elements per default [message #523926 is a reply to message #522447] |
Mon, 29 March 2010 17:04  |
Eclipse User |
|
|
|
Hi Jens,
Unfortunately, there is no way through preferences to control the details of how the content of the element should be formatted (outside of changing the max line width to something large enough to prevent formatting of the element). Currently, the best thing you can do is to either add a schema to control the whitespace or add the xml:space="preserve" attribute to the element.
|
|
|
Powered by
FUDForum. Page generated in 0.03177 seconds