Posted By:
Anonymous
Posted On:
Wednesday, July 28, 2004 10:25 AM
Xerces SAX Parser I'm coding a simple jsp file that parses an XML file. But i got this Exception: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed. This is the jsp file : <% /*@ page import = "org.xml.sax.ParserFactory"*/ %> <%@ page import = "org.xml.sax.SAXException" %> <%@ page import = "java.io.IOException" %> <% String xmlFile = "file:///C:/jakarta-tomcat-5.0.27/webapps/xerces/simple.xml"; String parserClass = "org.apache.xerces.parsers.SAXParser"; Parser parser = ParserFactory.
More>>
Xerces SAX Parser
I'm coding a simple jsp file that parses an XML file.
But i got this Exception:
org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
This is the jsp file :
<% /*@ page import = "org.xml.sax.ParserFactory"*/ %>
<%@ page import = "org.xml.sax.SAXException" %>
<%@ page import = "java.io.IOException" %>
<%
String xmlFile = "file:///C:/jakarta-tomcat-5.0.27/webapps/xerces/simple.xml";
String parserClass = "org.apache.xerces.parsers.SAXParser";
Parser parser = ParserFactory.makeParser(parserClass);
try {
parser.parse(xmlFile);
out.println("DONE");
} catch (Exception se) {
out.println(se.toString());
}
%>
<?xml version="1.0" encoding="UTF-8"?>
<?xml:stylesheet type="text/xsl" href="simple.xsl"?>
Belgian Waffles
$5.95
two of our famous Belgian Waffles
650
Strawberry Belgian Waffles
$7.95
light Belgian waffles
900
Berry-Berry Belgian Waffles
$8.95
light Belgian waffles
900
This is the XSl file (simple.xsl)
<?xml version="1.0">
-
(
calories per serving)
Why that error?
p.s. no space before
<?xml version="1.0"...