INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

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

(OP)
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 http://www.xmlvalidation.com/index.php?id=1&L=0.

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="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:catalog="http://www.superstarmovies.com/catalog"
                 xsi:schemaLocation="http://www.superstarmovies.com/catalog 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="http://www.w3.org/2001/XMLSchema"
           xmlns:lib="http://www.superstarmovies.com/library"
           xmlns="http://www.superstarmovies.com/catalog"
           targetNamespace="http://www.superstarmovies.com/catalog">          

<xs:import namespace="http://www.superstarmovies/library" schemaLocation="lib.xsd" />

   <xs:element name="catalog">
      <xs:complexType>
         <xs:all>
......

part of lib.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="http://www.superstarmovies.com/library"
           targetNamespace="http://www.superstarmovies.com/library">

<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//www.superstarmovies.com/catalog'.

Errors in file catalog.xsd:
     16:    68    TargetNamespace.1: Expecting namespace 'http//www.superstarmovies.com/catalog', but the target namespace of the schema document is 'http//www.superstarmovies.com/library'.
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close