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

[2983 byte] By [ervikasa] at [2007-10-2 21:35:29]
# 1
Well there's nothing wrong with your schema (I copyied it into XMLSpy and wasn't able to create two artifacts with the same name). My guess is that JAXB still does not support xsd:unqiue http://www.onjava.com/pub/a/onjava/2004/12/15/jaxb.html
SteveNaivea at 2007-7-14 0:49:30 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...