W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2002

Possibility to define a data type for element that are mixed

From: by way of <YLangevin@PROVANCE.COM>
Date: Mon, 16 Sep 2002 11:03:55 -0600
Message-Id: <5.1.0.14.1.20020916110352.02ae2950@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
Here is a section of my xml

<xsd:element name="GROUP">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="GROUP_TAG" minOccurs="0"/>

<xsd:element ref="DESCRIPTION" minOccurs="0"/>

</xsd:sequence>

<xsd:attributeGroup ref="ENTITY_ATTRIBUTE"/>

</xsd:complexType>

</xsd:element>

I've tried to declare the GROUP node as mixed and give him a data type, but 
it didn't work. See the following lines of codes.

<xsd:element name="GROUP">

<xsd:complexType mixed="true">

<xsd:complexContent>

<xsd:extension base="stNotEmptyTo255Length">

<xsd:sequence>

<xsd:element ref="GROUP_TAG" minOccurs="0"/>

<xsd:element ref="DESCRIPTION" minOccurs="0"/>

</xsd:sequence>

<xsd:attributeGroup ref="ENTITY_ATTRIBUTE"/>

</xsd:extension>

</xsd:complexContent>

</xsd:complexType>

</xsd:element>



I would like to be able to define the GROUP node as a mixed element with a 
string datatype with a minlength=0 and a maxLength=255. This will be really 
helpfull.

I've worked around it with other elements that do not contain a sequence, 
but I would like to be able to do it with an element that does contain a 
sequence.

<xsd:element name="GENERAL_LEASE">

<xsd:complexType mixed="true">

<xsd:simpleContent>

<xsd:extension base="stNotEmptyTo255Length">

<xsd:attributeGroup ref="ENTITY_VALUE_ATTRIBUTE"/>

</xsd:extension>

</xsd:simpleContent>

</xsd:complexType>

</xsd:element>



<xsd:simpleType name="stNotEmptyTo255Length">

<xsd:annotation>

<xsd:documentation>String with minlength = 1 and maxLength = 
255</xsd:documentation>

</xsd:annotation>

<xsd:restriction base="xsd:string">

<xsd:minLength value="1"/>

<xsd:maxLength value="255"/>

</xsd:restriction>

</xsd:simpleType>



If you need clarification or have any questions or comments, don't hesitate 
to contact me

thanks

Yves Langevin
Software Engineer, EAI
Provance Technologies Inc. - ISO 9001 Registered
<mailto:ylangevin@provance.com>mailto:ylangevin@provance.com
www.provance.com

IMPORTANT NOTICE: This information is the property of Provance Technologies 
Inc. and may contain data that is confidential or proprietary. If you have 
received this in error, please notify the originator immediately. Your 
assistance is appreciated. - Provance CONFIDENTIAL AND PRIVILEGED
Received on Monday, 16 September 2002 13:11:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:01 GMT