Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Can XML Schema represent this?

From: sburr@--------.--- (------ ----)
To: NULL
Date: 6/2/2004 6:24:00 AM
I would like to restrict the values of an attribute to boolean
expressions combining enumerated values. Is this possible?

An example instance document might look something like:

  <myElement expression="apples OR oranges"/>

I thought I'd start with something like:

  <xs:element name="myElement" type="myElementType"/>

  <xs:complexType name="myElementType">
    <xs:attribute name="expression" type="myAttributeType"/>
  </xs:complexType>

  <xs:simpleType name="myAttributeValues">
    <xs:restriction base="xs:string">
      <xs:enumeration value="apples"/>
      <xs:enumeration value="oranges"/>
      <xs:enumeration value="bananas"/>
      <xs:enumeration value="pears"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="myAttributeType">
    <xs:restriction base="myAttributeValues">

      <!-- WHAT GOES HERE TO ALLOW BOOLEAN EXPRESSIONS
           OF THE ENUMERATED TYPE VALUES? -->

    </xs:restriction>
  </xs:simpleType>


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