Hi Thomas
You're right on both counts. Well spotted!
;-)
I've made the default line seperator to be "\n" now
by default and the default encoding "UTF-8" rather than "UTF8".
Also I've made asXML() now depend on outputFormat =
new OutputFormat() which won't append any extra whitespace or new
lines.
Thanks for spotting these Thomas. These changes
should be in CVS by the time you've received this email.
James
----- Original Message -----
Sent: Saturday, June 16, 2001 9:18
PM
Subject: [dom4j-dev] Document.asXML()
uses CRLF?
Document.asXML() seems to depend
on outputFormat = new OutputFormat( " ", false
);
OutputFormat.java:42 has private String lineSeparator =
"\r\n"; which surprised me - from http://www.w3.org/TR/2000/REC-xml-20001006#sec-line-ends
: >>> To simplify the tasks of applications, the characters passed to an
application by the XML processor must be as
if the XML processor normalized all line breaks in external parsed entities
(including the document entity) on input, before parsing, by translating both
the two-character sequence #xD #xA and any #xD that is not followed by #xA to
a single #xA character. <<< I'm not sure whether this applies
tasXMLo (), but I'd thought the rule of thumb was "XML uses LF".
If
people do not want to change this, could a call
to outputFormat.setLineSeparator(System.getProperty("line.separator")); be
triggered by one of the OutputFormat constructors?
BTW, I think line 27
in OutputFormat.java private String encoding =
"UTF8"; should perhaps be "UTF-8" - see http://www.w3.org/TR/2000/REC-xml-20001006#charencoding
sec 4.3.3
Thanks
again, Thomas. _______________________________________________ dom4j-dev
mailing list [EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev
|