W3C स्कीमा 1.0 उदाहरण पर आधारित विशेषता मान विवश करने की क्षमता नहीं है दस्तावेज़।
Schematron ऐसे दस्तावेजों को मान्य करने के लिए एक महान उपकरण है जो इस तरह के कस्टम सत्यापन परिदृश्यों का पालन करता है।
उदाहरण के लिए:
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="child" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="children" type="xs:integer"/>
</xs:complexType>
<xs:assert test="@children = count(child)"/>
</xs:element>
XSD 1.1 वर्तमान में सैक्सन और Xerces में कार्यान्वित किया जाता:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<pattern>
<rule context="root[@children]">
<assert
id="children-value"
test="@children=count(child)"
flag="error">
The root/@children value must be equal to the number of child elements.
</assert>
</rule>
</pattern>
</schema>
स्रोत
2011-06-19 19:19:04
यही मैंने सोचा, धन्यवाद। – sebastien