[jdom-interest] CDATA problem

Jason Hunter jhunter at collab.net
Tue Jan 30 14:22:41 PST 2001


Sounds like you need to set the encoding on the file 
<?xml version="1.0" encoding="xxx"?> 
to be correct for the file contents.  If you don't specify an encoding
the Xerces parser is defaulting to UTF-8 (as per the XML spec) which is
prob'ly not the encoding you're using.  My guess is you need ISO-8859-1.

-jh-

Stan Hartin wrote:
> 
> Hello all:
> 
> Using beta 5 and the Xerces parser, how do I get around this error?
> 
> Thanks,
> 
> Stan
> 
> Data from XML file:
> 
>      <something><![CDATA[Windows NT®]]></something>
> 
> Code:
> 
>       // Build a document
>       Document doc = builder.build(instream);
> 
> Error message:
> 
> **Parsing Fatal Error**
>  Line: 206
>  URI: null
>  Message: An invalid XML character (Unicode: 0xae) was found in the CDATA
> section.
> org.jdom.JDOMException: Error encountered: Error encountered
>         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:320)
>         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:337)
>         at
> com.triactive.inv.InventoryProcessor.main(InventoryProcessor.java:115)
> Root cause: org.xml.sax.SAXException: Error encountered
>         at
> com.triactive.inv.InventoryErrorHandler.commonError(InventoryErrorHandler.ja
> va:71)
>         at
> com.triactive.inv.InventoryErrorHandler.fatalError(InventoryErrorHandler.jav
> a:54)
>         at
> org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1037)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocume
> ntScanner.java:643)
>         at
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
> LDocumentScanner.java:1351)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
> java:380)
>         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
>         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:302)
>         at org.jdom.input.SAXBuilder.build(SAXBuilder.java:337)
>         at
> com.triactive.inv.InventoryProcessor.main(InventoryProcessor.java:115)
> _______________________________________________
> 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