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 Richard Moster <ri...@moster.net> on 2002/10/16 06:59:50 UTC
[Error] :2:273: cvc-elt.1: Cannot find the declaration of element 'didl:DIDL'.
I have an XML file, referencing a schema that in turn imports another
schema. When I use the SAX2 parser to parse with validation, I'm getting
the following error:
[Error] :2:273: cvc-elt.1: Cannot find the declaration of element
'didl:DIDL'.
didl:DIDL is the root element of the XML file and is declared in the
imported schema (see below). The whole thing works just fine in XMLSpy5.
Is there a problem with the validation if the root element has a namespace
qualifier defined in the same element? The file parses fine, but I'm
getting that error message.
----------------------------------------------------------------------------
----
The XML file starts off:
<?xml version="1.0" encoding="UTF-8"?>
<didl:DIDL xmlns:didl="namespace1" xmlns="namespace2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="namespace2 F:/MyProjects/SCRPG/SCR_02.xsd">
where namespace1 and namespace2 are placeholders are placeholders for the
purpose of this email--the files actually use valid namespaces.
----------------------------------------------------------------------------
----
The beginning of the schema F:/MyProjects/SCRPG/SCR_02.xsd is:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="namespace2" xmlns:didl="namespace1"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="namespace2"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="namespace1" schemaLocation="didl-schema-mod.xsd"/>
----------------------------------------------------------------------------
----
The beginning of the imported schema didl-schema-mod.xsd is:
<?xml version="1.0">
<xsd:schema targetNamespace="namespace2" xmlns="namespace1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified" version="0.01">
<xsd:attributeGroup name="ID_ATTRS">
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
</xsd:attributeGroup>
<xsd:element name="DIDL">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Declarations"
minOccurs="0"/>
<xsd:choice>
<xsd:element ref="Container"/>
<xsd:element ref="Item"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
----------------------------------------------------------------------------
----