Quoting Stuart McCulloch <[EMAIL PROTECTED]>:

StAX can't preserve whitespace between attributes, between "<" and the
element name, whitespace after the last attribute and the ">", between "</"
and the end element name. Same goes for all pull parsers.

personally speaking, I don't actually mind if </ foo > is changed to </foo>
for me preserving comments and the general layout, such as indentation
is much more important than attribute spacing.

Same here, but how about newlines in the project element to keep the namespace declarations in view?

as Milos mentioned: how do you decide where to slot new elements, like
dependencies if there weren't any dependencies in the original pom - are
they always appended? do they inherit the surrounding indentation?

DecentXML doesn't try to be smarter than you. It just gives you all the tools to get what you want. It doesn't throw information away which was in the original file, so you can examine it and make an educated guess what would probably look right.

Even if it's not 100% correct, it will at least preserve all comments and processing instructions and other special XML data because the guy who wrote that XML probably had a reason to write it the way it is.

For example, the first version of the m2eclipse POM editor would remove all comments after "Add dependency". That's not cool. Those comments contained references to web pages and explanations why some stuff was set up "oddly".

Just looking at an XML gives you a visual clue: these guys couldn't care
less how it *looks* as long as their tools can read it.

usually I'm more concerned about getting it working than the *look*, in
fact often what I need is an XML formatting tool that I can apply to our
poms to make them consistent (ie. like formatting code in an IDE)

In that case, DecentXML is for you. With it, you can pick all the whitespace in the POM file (and *only* that) and replace it with something that is more correct. It will leave comments, etc. alone.

Or you can also reorder the elements without messing with the indentation.

I've been thinking about such a cleanup tool myself. All the POM creators create POMs which look different, which have a different indentation, different order of elements, etc. With DecentXML, all that could be fixed without messing with parts of the XML which we might want to preserve.

Regards,

--
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to