[jdom-interest] Problem when creating document using xml String with NCR format characters

Per Norrman per.norrman at austers.se
Fri Jul 2 02:20:55 PDT 2004


two things:

1) How do you convert the JDOM document to an XML string?

2) What is the actual Exception? 'Not valid' means that the document
fails to comply with a DTD or schema. If there are other errors, like
illegal characters or unbalanced tags, the document is not 'well formed'.


Zhiyong Zhang wrote:

> I have a xml document using UTF-8 encoding, which
> includes some characer using NCR format,like
> 北亰.
> then i read this file (with encoding UTF-8) and
> generate the xml Java String (Java Unicode encoding).
> then i pass this xml String to the JDOM utility method
> to convert this xmlString to JDOM Document object. The
> codes looks like:
>  SAXBuilder builder = new SAXBuilder();
>  Document   document = builder.build(new StringReader
> (xmlString));
> and then, i convert this document back to xml string
> and rebuild the document, jdom complained that this
> isnot an valid document. It seems that JDOM converting
> the NCR formatted character to other thing, and
> regards it as invalid document.
> any advice will be appreciate.
> ________________________________________________________________________
> Yahoo! Messenger - Communicate instantly..."Ping" 
> your friends today! Download Messenger Now 
> http://uk.messenger.yahoo.com/download/index.html
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

More information about the jdom-interest mailing list