Altova Mailing List Archives


Re: Problem Flattening XSD Files

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

Hi,

You can do it in a single step as:

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

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

Priscilla
-------------------------------------------------------------------------
Priscilla Walmsley
http://www.datypic.com
Author, Definitive XML Schema (Prentice Hall 2001)
XQuery (O'Reilly 2007)
-------------------------------------------------------------------------


"uncaged" <uncaged@d...> wrote in message 
news:25708CF6-628B-4A41-8C4C-2F5335515958@m......
> 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.
> 


Disclaimer

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 www.altova.com/list/index.html. 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.