JAXP:SAX: EntityResolver never used

T

Thomas Scheffler

Hi,


I use the Xerces SAXParser to read my documents in Java. For that I
wrote an EntityResolver so that the parse can use a schema to validate
them. Now that is the problem. The parser does never call my
EntityResolver and so gives out an error message

[java] INFO SystemID: ./xyz-01.xml
[java] INFO PublicID: null
[java] ERROR test.xml: line=8 : column=30 : message=cvc-elt.1:
Cannot find the declaration of element 'xyz'.
[java] org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the
declaration of element 'xyz'.

What do I have to do that the parser calls the EntityResolver to get the
InputSource of my schema files?

here are the first ew lines of a xml file sample:


<?xml version="1.0" encoding="iso-8859-1"?>
<xyz
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xyz-schema.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
label="test">
.....

My search in the net was without a result so this is a rather unusual
error I think. Can anybody help?

Greets

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top