You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by pi...@betasys.com on 2001/04/04 20:26:45 UTC
More validating schema problems...
Hello all,
I was looking through the recent schema validating posts, but didn't see a
complete resolution to the issues, or at least a resolution to the issue
that I am running into. This issue is with an error generated by the
parser when validating a schema: "Element type "test" must be declared."
I thought what I thought were valid xsd/xml documents and am calling the
parser correctly. I then took almost everything out of the files, and was
still getting the error.. Obviously I'm doing something wrong... I was
hopeing that someone would spot my mistakes. Also, I've been scouring the
schema tutorial at xml.com, which seems to be the best schema reference I
could find. I also downloaded a schema tutorial, and from what I can tell,
I'm doing what they say... I think I've got a reasonable handle on
schemas, except for this little problem... I'm guessing the problem is in
the header somewhere, as the parser does read from the schema file. I
can't find a good document on all the information that should/needs-to be
put in the header, anyone know of one?
I call the parser with: jre -classpath %xerces_CLASSPATH% sax.SAXCount -s
-v test.xml
My xml and xsd files look like:
<?xml version="1.0"?>
<test
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:schemaLocation="http://localhost test.xsd">
</test>
-------------------------------
<?xml version="1.0"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
targetNamespace="http://localhost"
xmlns="http://localhost"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:element name="test" />
</xsd:schema>
Thanks for any help!
-Pete