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

Restricting Element Order with Attribute Values

Subject: Restricting Element Order with Attribute Values
From: Rudi Starcevic <tech@xxxxxxxxxxxx>
Date: Tue, 27 Sep 2005 00:07:14 +1000
restricting order
Hi,

Is it possible to restrict elements based upon the order of element
attributes?

For example can I restrict
<server dn="myserver.com" id="server392" ip="xxx.xx.xxx.xxx">
<webstats uri="myserver.com/webalizer" type="http"/>
<webstats uri="myserver.com/bandwidth" type="bytes"/>
</server>

So I can say one cannot have a <webstats type='bytes'/> without first having
a <webstats type='http'/>

<xs:complexType name="webstatsType">
    <xs:attribute name="type">
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <!-- <xs:pattern value="http|bytes"></xs:pattern> -->
                <xs:enumeration value="http"/>
                <xs:enumeration value="bytes"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="uri" type="xs:anyURI"></xs:attribute>
    <xs:attribute name="username" type="xs:string"></xs:attribute>
    <xs:attribute name="pwd" type="xs:string"></xs:attribute>
</xs:complexType>  

Or should I not be using attributes for this type restriction and have
<bytes> elements
inside <http> elements?

I'm thinking if I can restrict the order of these elements in my xsd
files I can use
less <xsl:if> in my xsl files when sorting the different types
of web statistics available for each web site inside each server.

Thanks.
Regards,
Rudi.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
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-2013 All Rights Reserved.