You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Malia Zaheer <mz...@technicacorp.com> on 2002/02/04 19:49:36 UTC
xs:include not working
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
Re: xs:include not working
Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 4 Feb 2002, Malia Zaheer wrote:
> I used xs:include to add definitions from another xsd into the sample
> personal.xsd provided with the Xerces distribution like this:
you probably want to ask this on the xerces users list, not the xalan
users list.
- donald