Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » XML code formatter adds whitespace within elements per default
XML code formatter adds whitespace within elements per default [message #520891] Mon, 15 March 2010 12:41 Go to next message
keller_jens is currently offline keller_jens
Messages: 21
Registered: March 2010
Location: Germany
Junior Member
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 #522447 is a reply to message #520891] Mon, 22 March 2010 12:37 Go to previous messageGo to next message
keller_jens is currently offline keller_jens
Messages: 21
Registered: March 2010
Location: Germany
Junior Member
Hi,
is there anybody who can give a hint?

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 Go to previous message
Nick Sandonato is currently offline Nick Sandonato
Messages: 126
Registered: July 2009
Senior Member
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.
Previous Topic:How to create a Web Service Client from a Web Service with SSL.
Next Topic:Re: Using templates in HTML editor
Goto Forum:
  


Current Time: Thu Aug 21 02:20:35 EDT 2014

Powered by FUDForum. Page generated in 0.01680 seconds