K
Karl
Hi!
I'm trying with a really simple test, to use a schema within another, but
xmlspy keeps giving me error message: Schema Error - undefined value for
'type' encountered!
The file PersonGroup.xsd refuses to validate the Person type, even though
the include element. I know it finds the Person.xsd file, because I get a
"not found" error if I change the schemaLocation value. I thought I was
doing everything by the book, I just cant find the mistake!
It is as simple as this:
File: Person.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.test.com/schemas"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.test.com/schemas" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="Person">
<xs:complexType>
<xs:sequence>
<xs:element name="Phonenumber" type="xs:string"/>
<xs:element name="Firstname" type="xs:string"/>
<xs:element name="Lastname" type="xs:string"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
File: PersonGroup.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.test.com/schemas"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.test.com/schemas" elementFormDefault="qualified">
<xs:include schemaLocation="Person.xsd"/>
<xs:element name="PersonGroup">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Name"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="aPerson" type="Person" />
<xs:element name="PersonId" type="xs:IDREF"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
regards
Karl Z
I'm trying with a really simple test, to use a schema within another, but
xmlspy keeps giving me error message: Schema Error - undefined value for
'type' encountered!
The file PersonGroup.xsd refuses to validate the Person type, even though
the include element. I know it finds the Person.xsd file, because I get a
"not found" error if I change the schemaLocation value. I thought I was
doing everything by the book, I just cant find the mistake!
It is as simple as this:
File: Person.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.test.com/schemas"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.test.com/schemas" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="Person">
<xs:complexType>
<xs:sequence>
<xs:element name="Phonenumber" type="xs:string"/>
<xs:element name="Firstname" type="xs:string"/>
<xs:element name="Lastname" type="xs:string"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:ID" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
File: PersonGroup.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.test.com/schemas"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.test.com/schemas" elementFormDefault="qualified">
<xs:include schemaLocation="Person.xsd"/>
<xs:element name="PersonGroup">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Name"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="aPerson" type="Person" />
<xs:element name="PersonId" type="xs:IDREF"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
regards
Karl Z