File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes SAXParseException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SAXParseException" Watch "SAXParseException" New topic
Author

SAXParseException

Milan Vasic
Greenhorn

Joined: May 23, 2008
Posts: 3
Hi there this is my code:

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:directive.page contentType="text/html; charset=UTF-8" />
<jsputput doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

some html code....


</html>
</jsp:root>


I still got the exception :org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. Doeas anyone know why?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
There are methods in SAXParseException to get the line and column number that the parser objects to.

Bill
Milan Vasic
Greenhorn

Joined: May 23, 2008
Posts: 3
Tnx Bill.

vaske
Milan Vasic
Greenhorn

Joined: May 23, 2008
Posts: 3
I try to validate my jsp with a loot of on line validators, and my jsp is well formated, but when I try to parse that file with parse method on documentbuilder object I got this error.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Have you been able to extract the line and column from the exception?
How is the jsp source code being generated?

Bill
 
 
subject: SAXParseException