Skip to main content



      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 12:41 Go to next message
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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: Wed Jul 23 18:15:00 EDT 2025

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

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

Back to the top