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!
  • Students Click Here

*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.

Students Click Here


Novice XSD namespace question

Novice XSD namespace question

Novice XSD namespace question

I have an xsd I am trying to link up to an xml so the xml content will be validated (see below).  I am having trouble with namespaces.   If you attempt to validate as is, it fails stating on the brushes element and the only way I can get it to work is to undeclare the default namespace on the xml root element.  So I think I have a namespace conflict between the brushes element in the xsd and the brushes element in the xml.  Can't figure out why that is.  Any explanation is much appreciated.

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  <xs:element name="root">
        <xs:element name="brushes">
              <xs:element name="brush" minOccurs="0" maxOccurs="unbounded">
                  <xs:attribute name="id" type="xs:string" use="required"></xs:attribute>
                  <xs:attribute name="type" use="required">
                      <xs:restriction base="xs:string">
                        <xs:pattern value="image|video"></xs:pattern>
                  <xs:attribute name="uri" type="xs:string"></xs:attribute>
         <xs:element name="theme_references">
              <xs:element name="theme_reference" minOccurs="0" maxOccurs="unbounded">
                  <xs:attribute name="id" type="xs:string" use="required"></xs:attribute>
                  <xs:attribute name="icon_brush" type="xs:string" use="required"></xs:attribute>
                  <xs:attribute name="theme_uri" type="xs:string" use="required"></xs:attribute>

<?xml version="1.0" encoding="utf-8"?>
<root xmlns="mynamespace"
      xsi:schemaLocation="mynamespace theme_references.xsd">
    <brush id="alphabet_icon" type="image" uri="content\themes\alphabet\images\A.png"></brush>
    <theme_reference id="alphabet" icon_brush="alphabet_icon" theme_uri="content\themes\alphabet\alphabet.xml"></theme_reference>

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!

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