Exception in thread “main” javax.xml.stream.XMLStreamException: ParseError at [row,col]:[86,11]

Problem:

When parsing an xml file by using Stax, get the following error message:

Exception in thread "main" javax.xml.stream.XMLStreamException: ParseError at [row,col]:[86,11]
Message: Open quote is expected for attribute "{1}" associated with an element type "type_id".
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next
(XMLStreamReaderImpl.java:594)
at com.sun.xml.internal.stream.XMLEventReaderImpl.nextEvent
(XMLEventReaderImpl.java:85)
at Main.main(Main.java:49)

The problem is gone, when the following DOCTYPE line is removed:

<!DOCTYPE bugzilla SYSTEM "https://bugs.eclipse.org/bugs/bugzilla.dtd">

Solution:

inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);

This set the property to request processors that do not support DTDs.

Reference: http://download.oracle.com/javase/6/docs/api/javax/xml/stream/XMLInputFactory.html

Category >> StAX  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
<pre><code> 
String foo = "bar";
</code></pre>

Leave a comment

*