Altova Mailing List Archives

Re: Problem Flattening XSD Files

From: "Priscilla Walmsley" <nospam@-------.--->
Date: 6/3/2007 6:07:00 PM


You can do it in a single step as:

  <xs:complexType name="TemperatureType4">
      <xs:restriction base="xs:anyType">
          <xs:restriction base="xs:long">
            <xs:minInclusive value="0"/>
        <xs:attribute name="AnAttr" type="xs:string"/>

But why would you want to get rid of global types?

Priscilla Walmsley
Author, Definitive XML Schema (Prentice Hall 2001)
XQuery (O'Reilly 2007)

"uncaged" <uncaged@d...> wrote in message 
> I'm writing an XSD flattener, that gets rid of global simple and complex
> types by merging them into global elements as anonymous types.  Where I'm
> having trouble is when mixing restriction and extension of a 
> simpleContent.
> For example:
> <xs:simpleType name="positiveLong">
>  <xs:restriction base="xs:long">
>    <xs:minInclusive value="0"/>
>  </xs:restriction>
> </xs:simpleType>
> <xs:element name="positiveLongWithAttribute">
>  <xs:complexType>
>    <xs:simpleContent>
>      <xs:extension base="x:positiveLong">
>        <xs:attribute name="AnAttr" type="xs:string"/>
>      </xs:extension>
>    </xs:simpleContent>
>  </xs:complexType>
> </xs:element>
> Thanks in advance.


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.