W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2003

[xmlschema-dev] <none>

From: Winston Wongsosemito <w.wongso@logan.nl>
Date: Wed, 7 May 2003 20:08:22 +0200
Message-ID: <000801c314c3$a6ac3df0$6401a8c0@www.Logan.nl>
To: <xmlschema-dev@w3.org>
Could someone plz help me with the following problem, I want  to validate the xml where
the picklist element have  different value elements

That means that the xml below should give an error while validating with the xsd scheme,
but it still gives no error when I'm trying to do so...

the XML document

<validate xmlns="urn:API">
<xmldata>
   <picklist name="a1" description="B1" owner="6">
         <value>Picca</value>
         <value>Picca</value>
         <value>Picca</value>
   </picklist>

</xmldata>
</validate>



the XSD scheme

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:API" xmlns="urn:API" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="validate" type="validateType"/>

   <xs:complexType name="validateType">
      <xs:sequence>
            <xs:element name="xmldata" type="xmldataType" minOccurs="1" maxOccurs="1"/>
      </xs:sequence>
   </xs:complexType>

<xs:complexType name="xmldataType">
   <xs:sequence>
        <xs:element name="picklist" minOccurs="1" maxOccurs="1">
        <xs:complexType>
              <xs:sequence>
                  <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
              </xs:sequence>
              <xs:attribute name="name" type="xs:string" use="required"/>
              <xs:attribute name="description" type="xs:string" use="required"/>
              <xs:attribute name="owner" type="xs:integer" use="required"/>
        </xs:complexType>
        <xs:unique name="uniqueVALUE">
                <xs:selector xpath=".//value"/>
                <xs:field xpath="."/>
        </xs:unique> 
        </xs:element>
   </xs:sequence>
</xs:complexType>

</xs:schema>
Received on Thursday, 8 May 2003 07:39:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:37 GMT