Friday, 26 December 2014

How make attribute unique in xsd?



XML:



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<p:configuration xsi:schemaLocation="http://ift.tt/1HL3jyc ATMScreenConfiguration.xsd " xmlns:p="http://ift.tt/1HL3jyc" xmlns:xsi="http://ift.tt/ra1lAU">
<p:screen screenNumber="001" screenName="Do you need more time" />
<p:screen screenNumber="002" screenName="Do you need more time" />
<p:screen screenNumber="004" screenName="Currency prefix for amount entry" />
<p:screen screenNumber="004" screenName="Thousands separator for amount entry" />
</p:configuration>


XSD:



...
<xsd:element name="configuration" type="configuration.configuration.type">
<xsd:unique name="uConfiguration">
<xsd:selector xpath="screen" />
<xsd:field xpath="@screenNumber" />
</xsd:unique>
</xsd:element>


I whant attribute 'screenNumber' of 'screen' tag be unique. Where I've made a mistake?


No comments:

Post a Comment