Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > SAXParseException

Reply
Thread Tools

SAXParseException

 
 
Angela Stempfel
Guest
Posts: n/a
 
      10-22-2003
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:6
at
nesuto.gui.JPanelNetwork.jbuttonScan_actionPerform ed(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

 
Reply With Quote
 
 
 
 
William Brogden
Guest
Posts: n/a
 
      10-22-2003

"Angela Stempfel" <(E-Mail Removed)> wrote in message
news:bn5h3q$tk0di$(E-Mail Removed)-berlin.de...
> 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:6
> at
>

nesuto.gui.JPanelNetwork.jbuttonScan_actionPerform ed(JPanelNetwork.java:319)
> at
>

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


 
Reply With Quote
 
 
 
 
Chris Riesbeck
Guest
Posts: n/a
 
      10-22-2003
Angela Stempfel <(E-Mail Removed)> wrote in message news:<bn5h3q$tk0di$(E-Mail Removed)-berlin.de>...
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
org.xml.sax.SAXParseException: URI was not reported to parser for entity [document] byoder@hotmail.com Java 0 07-05-2007 09:34 PM
Please help!! SAXParseException: not well-formed (invalid token) jvictor118@yahoo.fr Python 4 03-27-2007 09:49 PM
Validation of DOM document throws org.xml.sax.SAXParseException: Marcin Cenkier XML 2 01-19-2006 01:44 PM
axis client gettng SAXParseException : Content is not allowed in prolog Nick Java 0 05-10-2004 10:49 PM
SAXParseException in JSP Marc Jordant Java 0 04-07-2004 03:46 PM



Advertisments