P
pstachy
Hi again!
I have another issue. I would like the attribute of the tag <invoice>
to be unique. Made the following schema but unfortunately it doesn't
validate. Could someone please indicate what is wrong or give me other
solution. Thanks Very much.
Regards
------------------------------------------------------------------------------------------------------------------
Schema:
<xs:element name="invoice">
<xs:complexType>
<xs:attribute name="number" type="xs:uniqueString" use="required"/>
<!-- I want the attribute 'number' to be unique
-->
</xs:complexType>
<xs:unique name="unique_fn_name">
<xs:selector xpath="invoice"/>
<xs:field xpath="@number"/>
</xs:unique>
</xs:element>
------------------------------------------------------------------------------------------------------
XML:
<invoices>
<invoice number="asd" /> <!-- unfortunately not unique yet -->
<invoice number="asd" />
<invoice number="acd" />
<invoice number="acd" />
</invoices>
I have another issue. I would like the attribute of the tag <invoice>
to be unique. Made the following schema but unfortunately it doesn't
validate. Could someone please indicate what is wrong or give me other
solution. Thanks Very much.
Regards
------------------------------------------------------------------------------------------------------------------
Schema:
<xs:element name="invoice">
<xs:complexType>
<xs:attribute name="number" type="xs:uniqueString" use="required"/>
<!-- I want the attribute 'number' to be unique
-->
</xs:complexType>
<xs:unique name="unique_fn_name">
<xs:selector xpath="invoice"/>
<xs:field xpath="@number"/>
</xs:unique>
</xs:element>
------------------------------------------------------------------------------------------------------
XML:
<invoices>
<invoice number="asd" /> <!-- unfortunately not unique yet -->
<invoice number="asd" />
<invoice number="acd" />
<invoice number="acd" />
</invoices>