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/04/21 19:15:25 UTC

DO NOT REPLY [Bug 8345] New: - Incorrectly identifying a restriction as invalid

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

Incorrectly identifying a restriction as invalid

           Summary: Incorrectly identifying a restriction as invalid
           Product: Xerces2-J
           Version: 2.0.1
          Platform: PC
        OS/Version: Windows 9x
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: binstock@pacifier.net


In an earlier version of Xerces, I am fairly
certain that the following restriction 
worked.

Note that I have modified this test code so that
the complex type specified by 
'POBoxAddressType'
is *identical* to its base:  'addressType'

Further, if I make 
'zipPlus4' global (and use
a 'ref' in the complex types), everything 
works
fine.

<xsd:schema 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="addressLine"
             
id="customerRecord.base.addressLine"
             type="xsd:string"
             abstract="true">
    
<xsd:annotation>
        <xsd:documentation xml:lang="en">
            The "addressLine" element type
            
is a base non-instantiable element
            type whose structure type is
            a built-in string 
datatype.
        </xsd:documentation>
    
</xsd:annotation>
</xsd:element>

<xsd:element name="POBox"
             
substitutionGroup="addressLine">
    <xsd:simpleType>
        <xsd:annotation>
            
<xsd:documentation xml:lang="en">
                The POBoxType demonstrates that
                a Substitution 
Group can have a
                type that is derived from the
                type used by the related
                non-instantiable 
base element.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction 
base="xsd:string">
            <xsd:maxLength value="10"/>
            <xsd:pattern value="[0-9]+"/>
        
</xsd:restriction>
    </xsd:simpleType>
</xsd:element>

<xsd:element 
name="effectiveDate"
             type="xsd:date"
             default="1900-01-01"/>

<xsd:complexType 
name="addressType">
    <xsd:sequence>
        <xsd:element ref="addressLine"
                     
minOccurs="1"
                     maxOccurs="2"/>
        <xsd:element name="city" type="xsd:string"/>
        
<xsd:element name="state" type="xsd:string"/>
        <xsd:element name="country" 
type="xsd:string" fixed="US"/>
        <xsd:element name="zip" type="xsd:string"/>
        
<xsd:element ref="effectiveDate"/>
    </xsd:sequence>
    <xsd:attribute 
name="zipPlus4"
                   use="optional">
        <xsd:simpleType>
            <xsd:restriction 
base="xsd:string">
                <xsd:pattern value="[0-9]{5}-[0-9]{4}"/>
            </xsd:restriction>
        
</xsd:simpleType>
    </xsd:attribute>
</xsd:complexType>

<xsd:complexType 
name="POBoxAddressType">
    <xsd:complexContent>
        <xsd:restriction 
base="addressType">
            <xsd:sequence>
                <xsd:element ref="addressLine"
                             
minOccurs="1"
                             maxOccurs="2"/>
                <xsd:element name="city" type="xsd:string"/>
                
<xsd:element name="state" type="xsd:string"/>
                <xsd:element name="country" 
type="xsd:string" fixed="US"/>
                <xsd:element name="zip" type="xsd:string"/>
                
<xsd:element ref="effectiveDate"/>
            </xsd:sequence>
    <xsd:attribute 
name="zipPlus4"
                   use="optional">
        <xsd:simpleType>
            <xsd:restriction 
base="xsd:string">
                <xsd:pattern value="[0-9]{5}-[0-9]{4}"/>
            </xsd:restriction>
        
</xsd:simpleType>
    </xsd:attribute>
        </xsd:restriction>
    
</xsd:complexContent>
</xsd:complexType>

</xsd:schema>

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