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
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() );