XML Validation against multiple schema Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ben

    #1

    XML Validation against multiple schema Error


    Hi All,
    I have 2 XSDs - one with the Types to be used throughout the
    application, and one specific to my module (a.xsd & b.xsd)

    a.xsd has

    <xs:attribute name="MyTest">
    <xs:simpleTyp e>
    <xs:restricti on base="xs:token" >
    <xs:enumerati on value="A" /> </xs:restriction>
    </xs:simpleType>
    </xs:attribute>

    b.xsd uses it as
    --Regular schema stuuf---
    <xs:import namespace="http ://schemas.mycompa ny.myproject"
    schemaLocation= "file:///C:/Program Files/XML/a.xsd"/>


    <xs:complexTy pe name="UserA">
    <xs:sequence>
    <xs:element name="Type" type="xs:token" />
    <xs:attribute name="MyTest" type="a:MyTest" />
    </xs:complexType>


    I get the error "type MyTest is not declared or is not a simple type
    xml".

    I have researched this for hours and cannot find a soultion .
    Any help is greatly appreciated.

    Thanks,
    Ben




    *** Sent via Developersdex http://www.developersdex.com ***
  • John Saunders

    #2
    Re: XML Validation against multiple schema Error

    "Ben" <nospam@devdex. comwrote in message
    news:O7NBSs5OHH A.4332@TK2MSFTN GP03.phx.gbl...
    >
    Hi All,
    I have 2 XSDs - one with the Types to be used throughout the
    application, and one specific to my module (a.xsd & b.xsd)
    >
    a.xsd has
    >
    <xs:attribute name="MyTest">
    <xs:simpleTyp e>
    <xs:restricti on base="xs:token" >
    <xs:enumerati on value="A" /</xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    >
    b.xsd uses it as
    --Regular schema stuuf---
    <xs:import namespace="http ://schemas.mycompa ny.myproject"
    schemaLocation= "file:///C:/Program Files/XML/a.xsd"/>
    >
    >
    <xs:complexTy pe name="UserA">
    <xs:sequence>
    <xs:element name="Type" type="xs:token" />
    <xs:attribute name="MyTest" type="a:MyTest" />
    </xs:complexType>
    >
    You want:

    <xs:attribute ref="a:MyTest"/>

    I don't recall if it also needs the name, but I don't think so. a:MyTest is
    the attribute. The simpleType is anonymous.

    John


    Comment

    Working...