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 2003/05/02 00:17:04 UTC

DO NOT REPLY [Bug 19532] New: - base - extension - restriction error

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=19532>.
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=19532

base - extension - restriction error

           Summary: base - extension - restriction error
           Product: Xerces2-J
           Version: 2.4.0
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: XML Schema Structures
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: donbate@iadfw.net


Xerces (StandardParserConfiguration) gives me an incorrect error in the enclosed
schemas. This is the result:

============================

[Error] xerces-bug2.xsd:13:30: derivation-ok-restriction.2.2: Error for type
'RestrictionType'.  An attribute use in this type does not have a matching
attribute use in the base, and, the base type does not have a wildcard which
matches this attribute use.
[Error] xerces-bug2.xsd:32:56: derivation-ok-restriction.2.2: Error for type
'Restriction2Type'.  An attribute use in this type does not have a matching
attribute use in the base, and, the base type does not have a wildcard which
matches this attribute use.
[Error] xerces-bug2.xsd:40:57: derivation-ok-restriction.2.2: Error for type
'#AnonType_restrict'.  An attribute use in this type does not have a matching
attribute use in the base, and, the base type does not have a wildcard which
matches this attribute use.

============================

These are the schemas:

xerces-bug.xsd:
----------------------------
<?xml version="1.0" encoding="UTF-8"?>

<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com)  -->

<xs:schema targetNamespace="urn:bs.bateconsulting.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:bs="urn:bs.bateconsulting.com"
elementFormDefault="qualified" attributeFormDefault="unqualified">

	<xs:element name="xerces-bug">

		<xs:annotation>

			<xs:documentation>Comment describing your root element</xs:documentation>

		</xs:annotation>

		<xs:complexType/>

	</xs:element>

	<xs:complexType name="BaseType" abstract="true">

		<xs:attribute name="foo" type="xs:string"/>

	</xs:complexType>

	<xs:complexType name="ExtensionType">

		<xs:complexContent>

			<xs:extension base="bs:BaseType"/>

		</xs:complexContent>

	</xs:complexType>

</xs:schema>

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

xerces-bug2.xsd:

-------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com)  -->

<xs:schema targetNamespace="urn:rs.bateconsulting.com"
xmlns:bs="urn:bs.bateconsulting.com" xmlns:rs="urn:rs.bateconsulting.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
attributeFormDefault="qualified">

	<xs:import namespace="urn:bs.bateconsulting.com" schemaLocation="xerces-bug.xsd"/>

	<xs:element name="xerces-bug2">

		<xs:annotation>

			<xs:documentation>Comment describing your root element</xs:documentation>

		</xs:annotation>

	</xs:element>

	<xs:complexType name="RestrictionType">

		<xs:complexContent>

			<xs:restriction base="bs:ExtensionType">

				<xs:attribute name="foo">

					<xs:simpleType>

						<xs:restriction base="xs:string">

							<xs:enumeration value="Test"/>

						</xs:restriction>

					</xs:simpleType>

				</xs:attribute>

			</xs:restriction>

		</xs:complexContent>

	</xs:complexType>

	<xs:simpleType name="RestrictedName">

		<xs:restriction base="xs:string">

			<xs:enumeration value="Test1"/>

			<xs:enumeration value="Test2"/>

		</xs:restriction>

	</xs:simpleType>

	<xs:complexType name="Restriction2Type">

		<xs:complexContent>

			<xs:restriction base="bs:ExtensionType">

				<xs:attribute name="foo" type="rs:RestrictedName"/>

			</xs:restriction>

		</xs:complexContent>

	</xs:complexType>

	<xs:element name="restrict">

		<xs:complexType>

			<xs:complexContent>

				<xs:restriction base="bs:ExtensionType">

					<xs:attribute name="foo" type="rs:RestrictedName"/>

				</xs:restriction>

			</xs:complexContent>

		</xs:complexType>

	</xs:element>

</xs:schema>


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

This will also produce errors but with slightly different messages is
xerces-bug2 type definitions are moved to the xerces-bug schema. Both of these
schemas are acceptable to XMLSPY 5.4 and XSV. It appears that Xerces is not
correctly looking through the extension type to the base type to determine that
the attribute restriction is valid.

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