using xpath in xsd pattern matching?

Is it possible to use an attributes value as part of a pattern match?

eg xsd:

    <xs:element name="MyElement">
    <xs:complexType>
        <xs:sequence>
            <xs:element ref="SomeElement" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="MyTestElement">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:pattern value="(Attribute name value) some other regex matching"/>
                </xs:restriction>
            </xs:simpleType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
</xs:element>

so basically the pattern match in MyTestElement should include the value of the outer elements name attribute, is this possible?


Source: xml

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.