Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (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 16:41 Go to next message
keller_jens is currently offline keller_jensFriend
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 16:37 Go to previous messageGo to next message
keller_jens is currently offline keller_jensFriend
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 21:04 Go to previous message
Nick Sandonato is currently offline Nick SandonatoFriend
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 Apr 25 21:38:07 GMT 2024

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

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

Back to the top