|
[
Permlink
| « Hide
]
Shay Banon added a comment - 26/Feb/09 07:52 AM
how do you configure it to use the looseless format? In your test (I have not ran it), what do you get back with the current implementation?
You get back
<test id="1">x y</test> The leading and trailing spaces are removed, and the double space between the x and y is reduced to a single space. It's possible that the double space thing is actually a bug in dom4j, it's hard to tell since the dom4j code isn't very well written. I think you can just call OutputFormat's default constructor to get a formatter which is lossless. Actually, org.dom4j.io.XMLWriter can be constructed without an OutputFormat, and it defaults to a lossless default.
Also, a similar problem exists with the JDOM converter (which should use getRawFormat rather than getCompactFormat). The org.w3c.dom implementation is fine, though.
Since you have a solution for now, I am going to aim at fixing it for 2.2 (I will make it configurable). I also want to simplify the content converter configuration a bit. Will report back once things are committed.
OK. Why the need to make it configurable, though? What value is there in the current behaviour?
I thought that users who don't mind the compact version problems, and prefer the benefit of having less data to store thanks to the compact form might want this feature. It will be turned "off" by default.
The simplification for XSEM configuration issue (which I wanted to do for ages) can be found here now:
I assume that loosless for dom4j means that I don't create an XmlWriter with an OutputFormat. Is that how you tested it?
That's correct, you just pass the StringWriter, no OutputFormat. The test passes OK with that.
ok, in 2.2 the default will be without any compaction.
In dom4j, the 'compass.xsem.contentConverter.dom4j.outputFormat' setting can be set to 'compact'. |
||||||||||||||||||||||||||||||||||||||||||