[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

defining elements with patterns and childelements

From: Andreas Peter <info@minimag.de>
Date: Tue, 11 Mar 2008 21:30:37 +0100
Message-ID: <47D6EBED.9040107@minimag.de>
To: XML Schema List <xmlschema-dev@w3.org>
defining elements with patterns and childelements

Hello schema-experts,

I spent the whole day with tinking and trying and now my head is totally 
empty. I have the following complexType which describes a listType for 
unordered and ordered lists:

    <xs:complexType name="listType">
        <xs:sequence>
            <xs:element name="unorderedlist" maxOccurs="unbounded">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="&#x02DC;.*"/>
                        <xs:pattern value="&#x2013;.*"/>
                        <xs:pattern value="&#x2022;.*"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
            <xs:element name="orderedlist" maxOccurs="unbounded">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0-9].*"/>
                        <xs:pattern value="[a-z].*"/>
                        <xs:pattern value="[i-iiii]{1,4}.*"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>


My aim: the element unorderedlist or orderedlist should start with an 
special pattern (see above) and after the pattern it should be possible 
to use text or other elelemts. 

Example:
<orderedlist>1. This is an orderedlist with a special<specchar> 
character</specchar> and again text.</orderedlist>
<orderedlist>2. This is an orderedlist again with a special<specchar> 
character</specchar>.</orderedlist>

Does anyone out there have an idea how to realise such an approach? I 
hope the question is understandable so far :-)

Thanks sooo much to everyone.
Andreas
Received on Tuesday, 11 March 2008 20:30:47 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.