Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use lib.xsd and catalog.xsd to validate catalog.xml, didn't work

Status
Not open for further replies.

loveca2012

Technical User
Mar 4, 2012
1
0
0
US
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&apos;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//
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top