[xml] Using xs:unique with attributes.
- From: soriano_s tsm es
- To: xml gnome org
- Subject: [xml] Using xs:unique with attributes.
- Date: Thu, 12 Jun 2003 12:19:49 +0200
Hi, i don't Know how can i describe unique constraint. The unique
must be using attribute value "Valor" of element "ide_proceso".
But in my xml I can do this without problems;
<?xml version="1.0" encoding="ISO-8859-1"?>
<cm_procesos xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="cm_procesos.xsd">
<fila>
<ide_proceso Valor="MEM"/>
</fila>
<fila>
<ide_proceso Valor="DMT"/>
</fila>
<fila>
<ide_proceso Valor="DMT"/>
</fila>
</cm_procesos>
I'm looking th w3 specification of Schemas and I dont't see the
error.
The XML Schema is:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="
qualified">
<xs:element name="cm_procesos">
<xs:complexType>
<xs:sequence>
<xs:element ref="fila" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="fila">
<xs:complexType>
<xs:sequence>
<xs:element ref="ide_proceso"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="ide_proceso">
<xs:selector xpath="fila"/>
<xs:field xpath="ide_proceso/@Valor"/>
</xs:unique>
</xs:element>
<xs:element name="ide_proceso">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="Valor" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="3"/>
<xs:minLength value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
Thank you.
Sergio Soriano Aina.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]