I need to format an xhtml file that contains some elements included in another namespace.
I searched all day for a really good mechanism for beautifully printing an XML file in java. I tested
- dom4j
- jdk (xerxes)
- my own xslt file
- jtidy
I am missing a really good formatting with the following options:
- setting line width
- wrapping attributes if maximum line width is reached
- alternative: align all attributes
- for empty elements, to include a space before closing the
<br/>vs tag<br /> - indicate the names of the elements where empty space does not matter
After my research, I came to the conclusion that to run my own xslt stylesheet, but I think that you cannot do 2. or 3. And I also did not succeed with 4 ..
Of course, the line width can be forced when white space is significant and so on. But is there any library that can do what I want?
Do you have any suggestions for me?
UPDATE: I am really looking for a network for a good xml beautifier / pretty printer. Nothing found. Eclipse does a good job, but I don't know how to extract a component from its core. There should be something like that. At the moment I am writing my own: - (
Eclipse has many options:

Something like this as a library would be nice.