You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by John Powell <jp...@sed.ara.com> on 2001/08/29 15:07:34 UTC
Xerces Validator - multiple schemas using xsi:type
Dear XERCES-J mailing list,
The following XML Instance file uses a derived type to extend a base type
which are defined in separate schemas. The XSV validator and XML spy are OK
with this syntax, but the Xerces 1_4_1 parser/validator gives me the
following error:
"[Error] instance.xml:4:43: General Schema Error: Type :
http://www.ara.com/ext,derivedModelType does not derive from the type of
element null."
Is this a known problem with the XERCES validator or are the other
validators letting something through that they shouldn't?
Is there a way to specify the same schemas or instance that works with all
validators?
INSTANCE.XML
<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="http://www.ara.com/base" xmlns:ext="http://www.ara.com/ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ara.com/ext ext.xsd ">
<generic xsi:type="ext:derivedModelType">
<base_info>base information</base_info>
<ext:ext_info>extra info for derived type</ext:ext_info>
</generic>
</model>
BASE.XSD
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://www.ara.com/base"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bas="http://www.ara.com/base" elementFormDefault="qualified">
<xsd:element name="model">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="generic" type="bas:MyBaseType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="MyBaseType">
<xsd:sequence>
<xsd:element name="base_info" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
EXT.XSD
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://www.ara.com/ext"
xmlns:ext="http://www.ara.com/ext"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bas="http://www.ara.com/base" xmlns="http://www.ara.com/ext"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.ara.com/base" schemaLocation="BASE.xsd"/>
<xsd:complexType name="derivedModelType">
<xsd:annotation>
<xsd:documentation>derives from an element of type from BASE
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="bas:MyBaseType">
<xsd:sequence>
<xsd:element name="ext_info" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
John Powell
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org