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 sa...@ca.ibm.com on 2001/03/19 21:01:29 UTC

Patch - Bugs & Fixes for simple type facet

Hi all,

Only enumeration and patterns can have multiple values within the same
derivation. But current Xerces-J treats the following definition as valid:

<simpleType name="mylong">
    <restriction base="long">
        <minExclusive value="100"/>
        <minExclusive value="200"/>
    </restriction>
</simpleType>

The following fix checks whether a facet has already been defined. If so,
it will report an error. The patch file is attached.

org.apache.xerces.validators.datatype:

diff -w -r1.116 TraverseSchema.java
1696a1697,1699
>                             if ( facetData.containsKey(facet) )
>
reportSchemaError(SchemaMessageProvider.DatatypeError,
>                                                   new Object [] {"The
facet '" + facet + "' is defined more than once."} );

Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-416) 448-3255
sandygao@ca.ibm.com

(See attached file: diff.txt)

Re: Patch - Bugs & Fixes for simple type facet

Posted by Elena Litani <hl...@jtcsv.com>.
Thank you, Sandy, I have applied the patch.
Elena

sandygao@ca.ibm.com wrote:
> 
> Hi all,
> 
> Only enumeration and patterns can have multiple values within the same
> derivation. But current Xerces-J treats the following definition as valid:
> 
> <simpleType name="mylong">
>     <restriction base="long">
>         <minExclusive value="100"/>
>         <minExclusive value="200"/>
>     </restriction>
> </simpleType>
> 
> The following fix checks whether a facet has already been defined. If so,
> it will report an error. The patch file is attached.
> 
> org.apache.xerces.validators.datatype:
> 
> diff -w -r1.116 TraverseSchema.java
> 1696a1697,1699
> >                             if ( facetData.containsKey(facet) )
> >
> reportSchemaError(SchemaMessageProvider.DatatypeError,
> >                                                   new Object [] {"The
> facet '" + facet + "' is defined more than once."} );
> 
> Cheers,
> Sandy Gao
> Software Developer, IBM Canada
> (1-416) 448-3255
> sandygao@ca.ibm.com
> 
> (See attached file: diff.txt)
> 
>   ------------------------------------------------------------------------
>                Name: diff.txt
>    diff.txt    Type: Plain Text (text/plain)
>            Encoding: base64
> 
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

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