Hello *,
doing some experiments with dom4j, I experience modifications of
- and
-entities
in attribute values:
running a filter, which first deserialises the xml-stream, performs some dom transformations
and then serialises the dom, in a first run, the entities mentioned get converted to
line-feeds {a fact, I could live with, since it's near loss-less}, which in a second run
through the filter will be converted to blanks. And this is, what I don't want to live with.
BTW: other SGML-entities in attributes are not touched.
Reading quite a bunch of docs and fiddling with the obvious parameters, I don't find a way
to let those entities be left unmodified. May be, this behaviour is not only a peculiarity
of dom4j, but of other XML-processors too.
Any ideas???
Markus
PS: setup of reader and writer:
-------8<------
// give reader...
; setReader(new SAXReader())
; getReader().setStripWhitespaceText(true)
; getReader().setMergeAdjacentText(true)
; getReader().setStringInternEnabled(true)
// ... and writer some reasonable defaults:
; setEncoding(new String("UTF-8"))
; setOutput_format(new OutputFormat("\t", true, getEncoding()))
; getOutput_format().setExpandEmptyElements(false)
; setWriter(new XMLWriter(getOutput_format()))
-------8<------