OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Schema issue with enumerated element content

[ Lists Home | Date Index | Thread Index ]

Hi,

On Fri, 2005-11-18 at 13:24 -0700, russ@weststreetconsulting.com 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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS