Shoutbox

XSD linking constraints to other elements - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: XSD linking constraints to other elements (/showthread.php?tid=92071)

XSD linking constraints to other elements by -dt- on 09-01-2009 at 05:55 AM

Hai

ok so i dont really know how to explain this but....


XML code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
 
<!-- our test element, which has an attribute called limit <test limit="10"/> --->
<xs:element name="test">
    <xs:complexType>
        <xs:sequence>
            <xs:attribute name="limit" type="xs:integer"/>
        <xs:sequence>
    </xs:complexType>
</xs:element>
 
<!-- our xxx element, which we define the numbers constraints --->
<xs:element name="xxx">
    <xs:complexType>
        <xs:sequence>
            <xs:attribute name="num" type="xs:integer">
                <xs:simpleType>
                    <xs:restriction base="xs:integer">
                        <xs:minInclusive value="2"/>
                        <xs:maxInclusive value="40"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        <xs:sequence>
    </xs:complexType>
</xs:element>
 
 
</xs:schema>



ok so thats my xml schema file, now what i want to do is link the maxInclusive value to the attribute in the <test> element

is there anyway to do that?

eg so <xs:maxInclusive value="test[@limit]"/> or something


edit:


so turns out its impossible :(