W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2002

Help!

From: by way of <CMerighe@natr.com>
Date: Wed, 10 Apr 2002 11:50:06 +0200
Message-Id: <5.1.0.14.1.20020410114959.02603b40@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
The instance document fails validation because the <mn> element appears
again after the <mo> element.  How can I change the definition in the schema
file to allow that?

Help to this problem, which would take me out of a dead end, would be truly
appreciated!!!!

Thanks!

Carlos Merighe.



---HERE IS THE SCHEMA FOR THE INSTANCE DOCUMENT BELOW:

<?xml version="1.0"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             targetNamespace="http://www.nsp.com/XCOMM1.0"
             xmlns="http://www.nsp.com/XCOMM1.0"	
             elementFormDefault="qualified">



     <xsd:annotation>
         <xsd:documentation xml:lang="en">
             XCOMM 1.0 data schema.
         </xsd:documentation>
     </xsd:annotation>

     <!-- Define the root element: XCOMM -->

     <xsd:element name="XCOMM">
         <xsd:complexType>
             <xsd:sequence>
                 <xsd:element name="Field" type="FieldType" minOccurs="0"
maxOccurs="unbounded"/>		
             </xsd:sequence>
         </xsd:complexType>
     </xsd:element>

     <!-- Define the FieldType type -->

     <xsd:complexType name="FieldType">
	<xsd:sequence>
	    <xsd:element name="mrow" type="MathmlType" minOccurs="0"
maxOccurs="unbounded"/>				
	</xsd:sequence>
         <xsd:attribute name="Name" type="xsd:string" use="required"/>

         <xsd:attribute name="Select" type="xsd:string" use="optional"/>

     </xsd:complexType>

     <!-- Define the MathmlType type -->

     <xsd:complexType name="MathmlType">
         <xsd:sequence>
     	    <xsd:element name="mi" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>				
	    <xsd:element name="mo" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>				
	    <xsd:element name="mn" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>				
         </xsd:sequence> 	
     </xsd:complexType>

</xsd:schema>

--------------HERE IS THE INSTANCE DOCUMENT THAT IS FAILING VALIDATION:

<?xml version="1.0"?>

<XCOMM     xmlns="http://www.nsp.com/XCOMM1.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation=  "http://www.nsp.com/XCOMM1.0
                                 xcomm.xsd">



     <Field
	Name="DistID"
	Select="Customers/Customer/@DistID"
     />

     <Field
	Name="Vol"
	Select="Customers/Customer/Orders/Order/Items/Item/Vol"
     />

     <Field
	Name="Qty"
	Select="Customers/Customer/Orders/Order/Items/Item/Qty"
     />

     <Field Name="CPV">
         <mrow>
	    <mn>2</mn>
	    <mo>+</mo>
	    <mn>3</mn>
	</mrow>
     </Field>


</XCOMM> 
Received on Wednesday, 10 April 2002 05:52:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:00 GMT