SAXParseException

A

Angela Stempfel

Hi all

while parsing a file i get the following error:

org.xml.sax.SAXParseException: Content is not allowed in trailing section.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at nesuto.parser.OsParser.<init>(OsParser.java:68)
at
nesuto.gui.JPanelNetwork.jbuttonScan_actionPerformed(JPanelNetwork.java:319)
at
nesuto.gui.JPanelNetwork_jbuttonScan_actionAdapter.actionPerformed(JPanelNetwork.java:765)
..................................

What does this error mean? I don't understand where it comes from. This
is the code where the error occurs:

try {
XMLReader xr = XMLReaderFactory.createXMLReader();
xr.setContentHandler(this);
xr.setErrorHandler(this);
FileReader r = new FileReader(xmlFile);
->> xr.parse(new InputSource(r));
}

I parse another file as well, in the same way...but there is no error.
Could there be something wrong with the xml Format?

Thanks for every help in advance

Angela
 
W

William Brogden

Angela Stempfel said:
Hi all

while parsing a file i get the following error:

org.xml.sax.SAXParseException: Content is not allowed in trailing section.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at nesuto.parser.OsParser.<init>(OsParser.java:68)
at
nesuto.gui.JPanelNetwork.jbuttonScan_actionPerformed(JPanelNetwork.java:319)
nesuto.gui.JPanelNetwork_jbuttonScan_actionAdapter.actionPerformed(JPanelNet
work.java:765)
.................................

What does this error mean? I don't understand where it comes from.

To locate what it is objecting to, extract the line number and column number
from the SAXParseException with something like:

}catch(SAXParseException spe ){
StringBuffer sb = new StringBuffer( spe.toString() );
sb.append("\n Line number: " + spe.getLineNumber());
sb.append("\nColumn number: " + spe.getColumnNumber() );
sb.append("\n Public ID: " + spe.getPublicId() );
sb.append("\n System ID: " + spe.getSystemId() + "\n");
log.println( sb.toString() );
 
C

Chris Riesbeck

Angela Stempfel said:
Hi all

while parsing a file i get the following error:

org.xml.sax.SAXParseException: Content is not allowed in trailing section.

I parse another file as well, in the same way...but there is no error.
Could there be something wrong with the xml Format?
Mostly like something wrong with the XML file, e.g.,
extra characters after the last closing tag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top