loveca2012
Technical User
Hi everyone,
I need to validate a file named catalog.xml, I constructed two XML Schema documents: one for a library of user-defined data types, and one for the catalog itself.
I got some error messages when i did the online validation using the tool
I suppose I messed up with namespaces among the three files but couldn't figure out how to fix the problem. I quote parts of the files and error messages here. Any input is welcome. Thanks in advance.
part of the catalog.xml:
<catalog:catalog xmlns:xsi=" xmlns:catalog=" xsi:schemaLocation=" catalog.xsd">
<movie id="m2001-012" genre="drama">
<title>Monster's Ball</title>
......
</catalog:catalog>
part of the catalog.xsd:
<xs:schema xmlns:xs=" xmlns:lib=" xmlns=" targetNamespace="
<xs:import namespace=" schemaLocation="lib.xsd" />
<xs:element name="catalog">
<xs:complexType>
<xs:all>
......
part of lib.xsd:
<xs:schema xmlns:xs=" xmlns=" targetNamespace="
<xs:simpleType name="actorID">
.......
error messages:
Errors in the XML document:
16: 89 cvc-elt.1: Cannot find the declaration of element 'catalog:catalog'.
Errors in file xml-schema:
18: 68 TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace of 'http//
Errors in file catalog.xsd:
16: 68 TargetNamespace.1: Expecting namespace 'http// but the target namespace of the schema document is 'http//
I need to validate a file named catalog.xml, I constructed two XML Schema documents: one for a library of user-defined data types, and one for the catalog itself.
I got some error messages when i did the online validation using the tool
I suppose I messed up with namespaces among the three files but couldn't figure out how to fix the problem. I quote parts of the files and error messages here. Any input is welcome. Thanks in advance.
part of the catalog.xml:
<catalog:catalog xmlns:xsi=" xmlns:catalog=" xsi:schemaLocation=" catalog.xsd">
<movie id="m2001-012" genre="drama">
<title>Monster's Ball</title>
......
</catalog:catalog>
part of the catalog.xsd:
<xs:schema xmlns:xs=" xmlns:lib=" xmlns=" targetNamespace="
<xs:import namespace=" schemaLocation="lib.xsd" />
<xs:element name="catalog">
<xs:complexType>
<xs:all>
......
part of lib.xsd:
<xs:schema xmlns:xs=" xmlns=" targetNamespace="
<xs:simpleType name="actorID">
.......
error messages:
Errors in the XML document:
16: 89 cvc-elt.1: Cannot find the declaration of element 'catalog:catalog'.
Errors in file xml-schema:
18: 68 TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace of 'http//
Errors in file catalog.xsd:
16: 68 TargetNamespace.1: Expecting namespace 'http// but the target namespace of the schema document is 'http//