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/03/08 23:30:40 UTC

DO NOT REPLY [Bug 6995] New: - xs:anySimpleType not recognized; simpleType derivation not correct.

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

xs:anySimpleType not recognized; simpleType derivation not correct.

           Summary: xs:anySimpleType not recognized; simpleType derivation
                    not correct.
           Product: Xerces2-J
           Version: 2.0.0
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: XML Schema datatypes
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: mfeblowitz@frictionless.com


Xerces2-J does not recognize xs:anySimpleType:

Schema error:  file:///c:/oagis/xml/schema/oagis/resources/fields.xsd#/schema
[1]/complexType[position() = 71 and @name = 'TimePeriodBase']/sequence
[1]/element[position() = 1 and @name = 'Start']
Undeclared XSD type : '{http://www.w3.org/2001/XMLSchema}anySimpleType'.

I'm trying to define the following:

	<xs:complexType name="TimePeriodBase" abstract="true">
		<xs:sequence>
			<xs:element name="Start" type="xs:anySimpleType" 
minOccurs="0"/>
			<xs:choice>
				<xs:element name="Duration" type="Duration" 
minOccurs="0">
								
	</xs:element>
				<xs:element name="Finish" 
type="xs:anySimpleType" minOccurs="0">
								
	</xs:element>
			</xs:choice>
		</xs:sequence>
		<xs:attribute name="inclusive" type="xs:boolean" use="optional" 
default="true"/>
	</xs:complexType>
	<xs:simpleType name="AnyDateTime">
		<xs:union memberTypes="Date DateTime"/>
	</xs:simpleType>
	<xs:complexType name="TimePeriodAny">
		<xs:complexContent>
			<xs:restriction base="TimePeriodBase">
				<xs:sequence>
					<xs:element name="Start" 
type="AnyDateTime" minOccurs="0">
									
	</xs:element>
					<xs:choice>
						<xs:element name="Duration" 
type="Duration" minOccurs="0">
										
		</xs:element>
						<xs:element name="Finish" 
type="AnyDateTime" minOccurs="0">
										
		</xs:element>
					</xs:choice>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>

If I leave out the xs:anySimpleType, I get the following error:

Schema error:  file:///c:/oagis/xml/schema/oagis/resources/fields.xsd#/schema
[1]/complexType[position() = 72 and @name = 'TimePeriodAny']
Invalid particle derivation by restriction.
Base type : '{http://www.openapplications.org/oagis}TimePeriodBase'
Derived type : '{http://www.openapplications.org/oagis}TimePeriodAny'

I believe both should work.

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