how to ensure the value of attribute in the set of values of another attribute?



This is a parameters configure.



<params>
<param name="use-schema" />
<param name="schema-domain" relyon="use-schema" />
<param name="schema-file" relyon="use-schema" />
</params>


And this is part of XSD content.



<xs:element name="param">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="relyon" type="xs:string" />
</xs:complexType>
</xs:element>


I wrote some basic xsd, but there's no restriction for relyon, how to write an XSD to ensure the value of attribute relyon is announced in params/param/@name?


No comments:

Post a Comment