[Home] [By Thread] [By Date] [Recent Entries]


Hi,

On Fri, 2005-11-18 at 13:24 -0700, russ@w... wrote:
> Thanks Kasimier. I think I'll just move enumerations into attributes.
> A little more complex for end users, but seemingly much better on the
> schema end.

The nice thing is that I learned - with the help of Henry's reply -
that the following (which I copied from Henry's answer and modified
a bit):

<xs:simpleType name="vals">
  <xs:list>
   <xs:simpleType>
    <xs:restriction base="xs:string"/>
   </xs:simpleType>
  </xs:list>
 </xs:simpleType>

 <xs:element name="ElemName">
  <xs:complexType>
   <xs:simpleContent>
    <xs:extension base="vals">
     <xs:attribute name="attr" type="xs:string"/>
    </xs:extension>
   </xs:simpleContent>
  </xs:complexType>
 </xs:element>

... is the same as:

<xs:element name="ElemName">
  <xs:complexType>
    <xs:simpleContent>
      <xs:restriction base="xs:anyType">
        <xs:simpleType>
          <xs:list>
            <xs:simpleType>
              <xs:restriction base="xs:string"/>
            </xs:simpleType>
          </xs:list>
        </xs:simpleType>
	<xs:attribute name="attr" type="xs:string"/>
      </xs:restriction>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

I'd prefer Henry's version - it looks easier to understand.

Regards,

Kasimier

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member