Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Problem Flattening XSD Files

From: uncaged@-----------.---------.---
To: NULL
Date: 6/3/2007 11:09:00 PM

Dear Priscilla,

Thank you so much.  I was trying to leave both the extension and restriction 
in the same element, which is illegal.

To answer your question, I have two versions of a very long XSD file.  I 
wrote an application to the older version and I must now update it to use the 
newer version, so I need to see what changed between the versions.  The 
problem is that the XSD has undergone significant structural and global name 
changes, so a text comparison is useless.  After I "flatten" both versions, 
I'll then be able to do a meaningful text comparison.

Thanks for your help, and for writing your highly-informative book, which 
I've been referring to regularly.


"Priscilla Walmsley" wrote:

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


transparent
Print
Mail
Like It
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.

.
.

transparent

transparent