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 ji...@apache.org on 2004/05/19 16:21:01 UTC

[jira] Closed: (XERCESJ-925) incorrect validation of restrictions of any

Message:

   The following issue has been closed.

   Resolver: Sandy Gao
       Date: Wed, 19 May 2004 7:20 AM

Seems we have consensus that this isn't actually a bug. Closing it.
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESJ-925

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESJ-925
    Summary: incorrect validation of restrictions of any
       Type: Bug

     Status: Closed
 Resolution: INCOMPLETE

    Project: Xerces2-J
 Components: 
             XML Schema Structures
   Versions:
             2.6.2

   Assignee: 
   Reporter: Eric J Schwarzenbach

    Created: Tue, 23 Mar 2004 9:39 PM
    Updated: Wed, 19 May 2004 7:20 AM
Environment: Operating System: Windows XP
Platform: PC

Description:
Given an open-ended base type defining a sequence containing any with a
maxOccurs ="unbounded", attempts to derive types by restriction from this,
replacing any with a sequence of multiple elements results in a Recurse.2 error.
My reading of the spec indicates that this should be validated against
NSRecurseCheckCardinality and it should be valid if I read those constraints
correctly.

Example. Base schema ("base-any.xsd"):

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://xml.wrycan.com/test/restr_sub"
xmlns:test="http://xml.wrycan.com/test/restr_sub"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified">
    <xs:element name="outer" type="test:outerType"/>
    <xs:complexType name="outerType">
        <xs:sequence>
            <xs:element ref="test:inner"/>
            <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element name="inner" type="test:innerType"/>
    <xs:simpleType name="innerType">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>
</xs:schema>

Derived schema which gets the error:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://xml.wrycan.com/test/restr_sub"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:test="http://xml.wrycan.com/test/restr_sub" elementFormDefault="qualified"
attributeFormDefault="unqualified">
    <xs:include schemaLocation="base-any.xsd"/>
    <xs:element name="dervOuter" type="test:dervOuterType"/>
    <xs:complexType name="dervOuterType">
        <xs:complexContent>
            <xs:restriction base="test:outerType">
                <xs:sequence>
                    <xs:element ref="test:inner"/>
                    <xs:sequence>                    
                        <xs:element ref="test:inner2"/>
                        <xs:element ref="test:inner3"/>
                    </xs:sequence>                    
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>
    <xs:element name="inner2" type="xs:token"/>
    <xs:element name="inner3" type="xs:token"/>
</xs:schema>

Removing either inner2 or inner3 results in validity.

(Note the patch for bug [Bug 27828] does not affect this)


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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