• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Following is the Exception i am getting while parsing an XML file,Could anyone tell me what would be the reason.
I am using SAXParser for parsing

org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the CDATA section.

at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanCDATASection(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)

at javax.xml.parsers.SAXParser.parse(Unknown Source)

at SaxParserUtil.parseDocument(SaxParserUtil.java:129)

at AdvSrchSAXPrser.main(AdvSrchSAXPrser.java:30)
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's the reason that "An invalid XML character (Unicode: 0x0) was found in the CDATA section"? Because there was an invalid XML character (Unicode: 0x0) in a CDATA section in your input document, and the parser found it there. That seems fairly straightforward to me. What is it that you don't understand about that?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The SAXParseException (org.xml.sax package) contains methods getColumnNumber() and getLineNumber() which you can use to find out where in your document a bad character occurs. The location should give you a clue as to what is writing that character.

Another useful tool is a programmer's editor which can show the hex value of each character - I use UltraEdit32.

How was the file created?

Bill
reply
    Bookmark Topic Watch Topic
  • New Topic