uniqueness for xml element is not validated with the <xsd:unique>
Hi
I am using <xsd:unique> to specify uniqueness for certain elements in the schema. But when i create the xml for the schema,it allows me to create elements with duplicate values for which the uniqueness is defined and also it is allowed to parse the xml correctly.I am using jaxb2.0 and jaxp2.0 to bind the xml and parse it. The schema is described below :
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="ArtifactDetails.xsd" />
<xsd:element name="EKMArtifacts">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Artifact" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ArtifactType" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="ArtifactName" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Status" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="VersionString" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Artifactdesc" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Functionaldesc" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Department" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Location" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Rated" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Category" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Createdby" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="OSPlatform" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="APPPlatform" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Country" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="State" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element name="Vendor" type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" />
<xsd:element ref="ArtifactDetails" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:unique name="ArtifactNameUnique">
<xsd:selector xpath="Artifact" />
<xsd:field xpath="ArtifactName" />
</xsd:unique>
</xsd:element>
</xsd:schema>
Can anyone help me out
Thanks in advance

