Hi Jing,

"Jing Yang" <[EMAIL PROTECTED]> wrote on 10/18/2007 04:10:48 PM:

> Use xerces_2_9_0 schema  API to load  specified  schema( see below)
> and print out retrieved pattern values.
> StringList patterns= simpleType.getLexicalPattern();
> Int size=patters.getLength();
> for(int i=0; i< size; i++){
>       System.out.println(?index ?+index+ ?  regex : " +
patterns.item(i));
> }
>
> The result as :
> index of 0   regex : [0-9]{1,3}
> index of 1   regex : [\-+]?[0-9]+
>
> Why does I get extral  pattern value  of  ?[\-+]?[0-9]+? ?

It's inherited from xs:integer which restricts xs:decimal by specifying
this pattern. See the Schema for Schemas [1].

>
------------------------------------------------------------------------------------------------------------------------------
>
> <xsd:simpleType name="NumberOrderedType">
>             <xsd:restriction base="xsd:integer">
>                         <xsd:minInclusive value="0"/>
>                         <xsd:maxInclusive value="999"/>
>                         <xsd:pattern value="[0-9]{1,3}"/>
>             </xsd:restriction>
> </xsd:simpleType>

Thanks.

[1] http://www.w3.org/TR/xmlschema-2/#schema

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to