[ 
http://issues.apache.org/jira/browse/XERCESC-1512?page=comments#action_12360535 
] 

Grant Slade commented on XERCESC-1512:
--------------------------------------

The VoiceXML 2.0 and 2.1 schema's have many patterns which contain multiple 
expressions 
Using Redhat Enterprise Linux 3 Update 3 and xerces-c-2.7.0 we have found the 
same issues raised here in bug XERCESC-1512.
eg <xsd:pattern value="([a-zA-Z]|[a-zA-Z$][a-zA-Z0-9_$]*[a-zA-Z0-9_])"/>  will 
match the first option successfully but fail for matches that should pass the 
2nd option.

This is a snippet of the vxml-datatypes.xsd which contains the issue
    <xsd:simpleType name="RestrictedVariableName.datatype">
        <xsd:annotation>
            <xsd:documentation>Variable name which are NMTOKEN. Additional
        constraints: doesn't start with "_", doesn't contain "." , must
follow ECMAScript variable naming conventions; not include ECMAScript
reserve words</xsd:documentation>
        </xsd:annotation>
        <!-- was xsd:NMTOKEN -->
      <xsd:restriction base="xsd:token">
        <xsd:pattern value="([a-zA-Z]|[a-zA-Z$][a-zA-Z0-9_$]*[a-zA-Z0-9_])"/> 
      </xsd:restriction>
    </xsd:simpleType>


Another example of the issue occurs in the grammar-core.xsd again where 
multiple patterns are defined - snippet follows
    <xsd:simpleType name="Repeat.datatype">
        <xsd:annotation>
            <xsd:documentation>
does not expression the constraint in n-m that m must be greater than n
</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="[0-9]+"/>
            <xsd:pattern value="[0-9]+-([0-9]+)?"/>
            <xsd:pattern value="([0-9]+)?-[0-9]+"/>
        </xsd:restriction>
    </xsd:simpleType>

Hope this info helps.




> Bad XS:pattern interpretation for XSD
> -------------------------------------
>
>          Key: XERCESC-1512
>          URL: http://issues.apache.org/jira/browse/XERCESC-1512
>      Project: Xerces-C++
>         Type: Bug
>   Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>     Versions: 2.6.0
>  Environment: Windows 2000 SP4, VC 6 SP4 used to compiled the xerces 
> libraries (C++ & Perl).
> I call the Xerces library from perl with the XML::Xerces - perl glue library
>     Reporter: Olivier Quintens
>     Assignee: Alberto Massari

>
> Hi,
> The code validates xml messages against a enterprise standard XSD.
> The following structure defines the tag validation
> <xs:element name="ENTRY_TIME_STAMP" type="typeDateSeconds" minOccurs="0"/>
> .....
> <xs:simpleType name="typeDateSeconds">
>       <xs:restriction base="xs:string">
>              <xs:pattern value="[0-9]{14}|[0-9]{16}"/>
>       </xs:restriction>
> </xs:simpleType>
> When the tag ENTRY_TIME_STAMP contains a value which match the first part 
> ([0-9]{14}), the xml is considered as valid.
> e.g : <ENTRY_TIME_STAMP>20051006082856</ENTRY_TIME_STAMP>
> When the tag ENTRY_TIME_STAMP contains a value which match the first part 
> ([0-9]{16}), the validator parser failed
> e.g : <ENTRY_TIME_STAMP>2005100608285631</ENTRY_TIME_STAMP> 
> Threturn error is  like 
> Reason :
> ERROR:
> FILE:    FAKE_SYSTEM_ID
> LINE:    1
> COLUMN:  211
> MESSAGE: Datatype error: Type:InvalidDatatypeValueException, Message:Value 
> '2005100608285631' does not match regular expression facet 
> '([0-9]{14}|[0-9]{16})'.
> Cheers
> Olivier

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to