- From: Gary Cramblitt <garycramblitt@comcast.net>
- Date: Tue, 26 Mar 2002 19:56:25 -0500
- To: xmlschema-dev@w3.org
I'm having a problem defining UNIQUE constraints. When I validate my schema using Schema Quality Checker (SQC), it reports <xs:field xpath="RadioService"/> evaluates to <xs:element name="RadioService" maxOccurs="1" minOccurs="1" nillable="false" type="HasClassification"/> whose type is not a simple type. Here's a fragment of my schema <xs:simpleType name="SecurityPickList"> <xs:restriction base="xs:string"> <xs:enumeration value="U"/> <!-- Unclassified --> <xs:enumeration value="C"/> <!-- Confidential --> <xs:enumeration value="S"/> <!-- Secret --> <xs:enumeration value="T"/> <!-- Top Secret --> </xs:restriction> </xs:simpleType> <xs:complexType name="HasClassification"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Class" type="SecurityPickList" use="optional"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:element name="Rec_SelRadioSrvc" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:all> <xs:element name="LineID"/> <xs:element name="RadioService" type="HasClassification"/> </xs:all> <xs:attribute name="id" type="xs:string" use="required"/> </xs:complexType> <xs:unique name="ID_SelRadioSrvc"> <xs:selector xpath="."/> <xs:field xpath="LineID"/> <xs:field xpath="RadioService"/> <!-- ERROR OCCURS HERE --> </xs:unique> </xs:element> <!-- Rec_SelRadioSrvc --> Obviously, the error occurs because the field xpath resolves to a complexType called "HasClassification". But HasClassification is an element with simpleContent and an optional attribute. Basically, I'm trying to create a schema to describe a database export. Most of the data items in the database have an optional attribute called "Class" which is the classification (Unclassified, Confidential, or Secret) of the data item. Can anyone suggest a workaround? Is there some way to define the xpath to resolve only to the RadioService element so that the schema will validate? -- Gary Cramblitt garycramblitt@comcast.net
Received on Tuesday, 26 March 2002 19:57:05 UTC