Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...What you have done for people like me is immeasurably helpful."

Geography

Where in the world do Tek-Tips members come from?

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

loveca2012 (TechnicalUser)
4 Mar 12 16:58
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'.
 

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!

Back To Forum

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