Hi,
In the unique constraint you defined a selector to match item elements
in no namespace (in XPath 1.0 there is no notion of default namespace
and your XPath nametest item means the item element from no namespace).
You need to declare the element namespace associated with a prefix and
use that prefix to qualify the nametest in the XPath expression. I also
added a couple of missing attribute declarations to your schema and a
working sample is below:
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema xmlns:xs="
http://www.yqcomputer.com/ "
targetNamespace="jabber:iq:privacy"
xmlns="jabber:iq:privacy" elementFormDefault="qualified"
xmlns:privacy="jabber:iq:privacy">
<xs:element name="query">
<xs:complexType>
<xs:sequence>
<xs:element ref="list" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element ref="item" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name"/>
</xs:complexType>
<xs:unique name="item1">
<xs:selector xpath="privacy:item"/>
<xs:field xpath="@order"/>
</xs:unique>
</xs:element>
<xs:element name="item">
<xs:complexType>
<xs:attribute name="order" type="xs:unsignedInt" use="required"/>
<xs:attribute name="action"/>
</xs:complexType>
</xs:element>
</xs:schema>
Best Regards
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/De ***
http://www.yqcomputer.com/