Hi I have a xml like this:
<xml><fullname>
<name attrib="true"/>
<lastname1 attrib="false"/>
<lastname2 attrib="false"/></fullname></xml>
I need to create a schema to validate it in such a way that it will allow only 1 attrib with value "true" (and the rest of them must be false [the attrib attribute is defined to be xs:boolean]), so i added a unique check in the element fullname like this:
<xs:unique name="attribcheck">
<xs:selector xpath="name|lastname1|lastname2"/>
<xs:field xpath="@attrib"/>
Of course, it will detect that there is a duplicated "true", but also, it will detect a duplicated "false". Does anyone know if there is a way to set a restriction on which value to apply the unique constraint? meaning that i can ensure that only one of them is "true" at any given time