Help with namespaces in xsd Schema please?

Discussion in 'XML' started by Ingrid, Aug 19, 2004.

  1. Ingrid

    Ingrid Guest

    I am trying to create a schema with my own namespace/prefix "in:"
    instead of xs: (to be able to import it into a different schema
    afterwards) - but can't seem to make it work.

    Trying to validate the schema below, the parser keeps on finding an
    error at line <in:extension base="pageRange">

    The same schema validates ok when the conventional xs: namespace is
    used.

    Any ideas?

    Ingrid

    <in:schema targetNamespace="http://did/in"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xmlns:in="http://www.w3.org/2001/XMLSchema" >

    <in:element name="num" type="numType"></in:element>

    <in:complexType name="numType">
    <in:simpleContent>
    <!-- ERROR ---- ???>
    <in:extension base="pageRange">
    <!-- ERROR ---- ????>
    <in:attribute name="type" use="required">
    <in:simpleType>
    <in:restriction base="in:string">
    <in:enumeration value="page
    range"></in:enumeration>
    </in:restriction>
    </in:simpleType>
    </in:attribute>
    </in:extension>
    </in:simpleContent>
    </in:complexType>
    <in:simpleType name="pageRange">
    <in:restriction base="in:string">
    <in:minLength value="3"></in:minLength>
    <in:maxLength value="7"></in:maxLength>
    <in:pattern value="\d{1,3}-\d{1,3}"></in:pattern>
    </in:restriction>
    </in:simpleType>
    </in:schema>
     
    Ingrid, Aug 19, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,546
    Markus
    Nov 23, 2005
  2. Burak
    Replies:
    0
    Views:
    574
    Burak
    Jul 1, 2004
  3. stiank81
    Replies:
    4
    Views:
    15,404
    stiank81
    Jun 26, 2005
  4. Rushi
    Replies:
    1
    Views:
    555
  5. Replies:
    5
    Views:
    1,029
    Brian McCauley
    Nov 29, 2006
Loading...

Share This Page