Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Attributes, simpleContent, etc.

From: "Jon Berndt" <jsb@------.--->
To: <xmlschema-dev@--.--->
Date: 11/27/2005 1:54:00 AM
> Oops, I think I missed a bit.  I think you have to do this in two stages:
>
> 1. Create the positive double by restricting double.
>
> 2. Extending the new positive double simpleType into a simpleContent.
>

Thanks, Pete:

After thinking about this I decided that it would also be good to have an AreaType and a
LengthType, etc., which will be helpful shorthand in the remainder of the schema. So, with
your suggestions above, this becomes:

<!-- Global Types for this file -->

<xs:simpleType name="AreaType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="M2"/>
    <xs:enumeration value="FT2"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="PositiveNumber">
  <xs:restriction base="xs:double">
    <xs:minExclusive value="0"/>
  </xs:restriction>
</xs:simpleType>

<!-- Wing Area -->

<xs:element name="wingarea">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="PositiveNumber">
        <xs:attribute name="unit" use="optional" default="FT2"
           type="AreaType"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

The above definition worked well, and the documentation was produced correctly in
oXygenXML, which also validated the following XML:

<wingarea unit="FT2"> 174.0 </wingarea>

Thanks for your help. This is fun stuff, but sometimes frustrating.

Jon
Project Coordinator,
JSBSim Flight Dynamics Model Project
www.jsbsim.org


From mark@a... Wed Nov 30 13:14:42 2005
Received: from wiggum.w3.org ([128.3


transparent
Print
Mail
Digg
delicious
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