You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/08/26 23:37:41 UTC

DO NOT REPLY [Bug 12057] New: - does not work properly

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12057>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12057

<xs:include> does not work properly

           Summary: <xs:include> does not work properly
           Product: Xerces2-J
           Version: 2.0.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: XML Schema Structures
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: cdillard@polexis.com


Xerces' handling of the XML schema <include> tag is broken.

I tracked it down to the class "XSDHandler".  In its constructTrees method, it 
does a String comparison using "!=".  Apparently the included namespace String 
hasn't been "intern"ed yet, so the comparison yeilds the wrong result.  Here 
are two simple schemas that, when loaded, demonstrate the problem (I use 
XMLSchemaLoader to load "b.xsd"):

---- a.xsd ----

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://chris01" xmlns:tns="http://chris01" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" 
attributeFormDefault="unqualified">
	<xs:simpleType name="MyType">
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
	<xs:element name="MyElement" type="tns:MyType"/>
</xs:schema>

---- b.xsd ----

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://chris01" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://chris01" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:include schemaLocation="a.xsd"/>
	<xs:element name="ImportingRoot">
		<xs:annotation>
			<xs:documentation>Comment describing your root 
element</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="tns:MyElement"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

---------------

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org