Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314293 - XML formatter inserts newline in XML header
Summary: XML formatter inserts newline in XML header
Status: RESOLVED WORKSFORME
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Rakesh CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-25 11:36 EDT by Matthew Adams CLA
Modified: 2010-07-12 05:07 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Adams CLA 2010-05-25 11:36:45 EDT
Build Identifier: M20100211-1343

If an xml file has a header of the form

<?xml version="1.0" encoding="UTF-8"?>

and the user formats it (Shift-Ctrl-F), the formatter inserts a newline in the xml header such that it looks like

<?xml version="1.0"
      encoding="UTF-8"?>

Inserting the newline causes many parsers (like the one Ivy uses) to throw an exception.  Regardless of the formatter's settings, it should ensure to leave the standard xml header element on a single line.

Reproducible: Always

Steps to Reproduce:
1. Create an xml document with a header of <?xml version="1.0" encoding="UTF-8"?>
2. Format it.
3. Observe newline between the version and encoding attributes.
Comment 1 Rakesh CLA 2010-05-27 06:04:53 EDT
I am not able to reproduce it on I20100520-0800 build .What preferences are enabled in XML->XML Files->editor?
Comment 2 Matthew Adams CLA 2010-05-27 11:48:36 EDT
(In reply to comment #1)
> I am not able to reproduce it on I20100520-0800 build .What preferences are
> enabled in XML->XML Files->editor?

I think I've changed my settings since I first noticed the error and don't recall what they were when this first took place -- this formatting was going on unknowingly by us for some time before we discovered it.  The fact that it was happening on when editing Maven POM files in the POM editor might have something to do with it.

With my current settings, I cannot reproduce the behavior either now.  :(
Comment 3 Rakesh CLA 2010-07-12 05:07:51 EDT
Resolving it , since it is not reproducible.Please reopen if you are able to reproduce.