-----Original Message-----
From: Andreas V�lker [mailto:[EMAIL PROTECTED]
Sent: 18 February 2002 14:22
To: [EMAIL PROTECTED]
Subject: errors while loading and validating a XSL fileHi,
I am using Xerces2 Java Parser 2.0.0 and try to load and validate a XSL file like this ...<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template></xsl:stylesheet>
with the following java method ...
public void load(String filename) throws P2XMLException
{
DocumentBuilderFactory dbf;
DocumentBuilder db;
Document doc;
Transformer transformer;
StreamResult result;
try {
dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setValidating(true);
dbf.setAttribute("http://apache.org/xml/features/validation/schema",
new Boolean(true));
db = dbf.newDocumentBuilder();
db.setErrorHandler(new XMLDocument.XmlErrorHandler());
System.out.println("load jaxp");
doc = db.parse(filename);
// ...
}
and get errors like this
Error at 3/66: cvc-elt.1: Cannot find the declaration of element 'xsl:stylesheet
'.
Error at 5/42: cvc-elt.1: Cannot find the declaration of element 'xsl:output'.
Error at 7/35: cvc-elt.1: Cannot find the declaration of element 'xsl:template'.Error at 8/15: cvc-elt.1: Cannot find the declaration of element 'xsl:copy'.
Error at 9/48: cvc-elt.1: Cannot find the declaration of element 'xsl:apply-temp
lates'.
Error at 13/35: cvc-elt.1: Cannot find the declaration of element 'xsl:template'
.
...thanks
The information transmitted by this e-mail message is intended solely for the use of the person to whom or entity to which it is addressed. The message may contain information that is privileged and confidential. Disclosure, dissemination, distribution, review, retransmission to, other use of or taking any action in reliance upon this information by anyone other than the intended recipient is prohibited. If you are not the intended recipient, please do not disseminate, distribute or copy this communication, by e-mail or otherwise. Instead, please notify us immediately by return e-mail (including the original message with your reply) and then delete and discard all copies of the message.
Although we have taken precautions to minimize the risk of transmitting viruses we nevertheless advise you to carry out your own virus checks on any attachment to this message. We accept no liability for any loss or damage caused by viruses.
