Привет, у меня есть xml, как это:
<xml><fullname>
<name attrib="true"/>
<lastname1 attrib="false"/>
<lastname2 attrib="false"/></fullname></xml>
Мне нужно создать схему для ее проверки таким образом, чтобы она разрешала только 1 атрибут со значением «истина» (а остальные должны быть ложными [атрибут атрибута определен как xs: boolean]), поэтому я добавлена уникальная проверка полного имени элемента, например:
<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