You might try using double quotes instead of single quotes around attribute values. I'm not sure if that will matter, but it might.

Ed

---

From: Malia Zaheer <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: xs:include not working
Date: Mon, 4 Feb 2002 13:49:36 -0500

Hi,

I used xs:include to add definitions from another xsd into the sample
personal.xsd provided with the Xerces distribution like this:

 <xs:element name="person">
  <xs:complexType>
   <xs:sequence>
     <xs:element ref="name"/>
     <xs:element1 ref="email" minOccurs='0' maxOccurs='unbounded'/>
     <xs:element ref="url"   minOccurs='0' maxOccurs='unbounded'/>
     <xs:element ref="link"  minOccurs='0' maxOccurs='1'/>
     <xs:element ref="employee" minOccurs='1' maxOccurs='unbounded'/>
        <xs:include schemaLocation="employee.xsd"/>

   </xs:sequence>


However, when I try to validate an xml file containing elements from employee.xsd, I get an error like this:

**Error encountered**
  Line:    41
  URI:     personal-schema.xml
  Message: cvc-complex-type.2.4.a: Invalid content starting with element
'employee'. The content
t match '("":person){1-UNBOUNDED}'.


The content of employee.xsd is:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace='http://www.technicacorp.com/DM'
xmlns:xs='http://www.w3.org/2001/XMLSchema'>

 <xs:documentation <xs:element name="employees">
  <xs:complexType>
   <xs:sequence>
     <xs:element ref="employee" minOccurs='1' maxOccurs='unbounded'/>
   </xs:sequence>
  </xs:complexType>
 </xs:element>  </xs:documentation>

 <xs:element name="employee">
  <xs:complexType>
   <xs:sequence>
     <xs:element ref="name"/>
     <xs:element ref="email" minOccurs='0' maxOccurs='unbounded'/>
   </xs:sequence>
   <xs:attribute name="salary" type="xs:integer"/>
  </xs:complexType>
 </xs:element>

 <xs:element name="name" type='xs:string'/>

 <xs:element name="email" type='xs:string'/>
</xs:schema>



It seems like it is not importing the definitions in employee.xsd.  What am
I missing?  Plesae help.

thanks in advance,
Malia


_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.



Reply via email to