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 2001/06/06 18:11:19 UTC
[Bug 2029] New: - The parser does not report errors for some invalid regular expressions used with the facet, pattern
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2029
*** shadow/2029 Wed Jun 6 09:11:19 2001
--- shadow/2029.tmp.11173 Wed Jun 6 09:11:19 2001
***************
*** 0 ****
--- 1,85 ----
+ +============================================================================+
+ | The parser does not report errors for some invalid regular expressions use |
+ +----------------------------------------------------------------------------+
+ | Bug #: 2029 Product: Xerces-J |
+ | Status: NEW Version: 1.4 |
+ | Resolution: Platform: Other |
+ | Severity: Normal OS/Version: Other |
+ | Priority: Other Component: Schema-Datatypes |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xerces-j-dev@xml.apache.org |
+ | Reported By: nddelima@ca.ibm.com |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ The value of the facet "pattern" should be a valid regular expression.
+ The parser does not raise an error when the value of this facet in a simpleType
+ declaration has an invalid regular expression value as in the case below:
+
+ sample.xsd
+ ==========
+ <?xml version="1.0"?>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.schemaTest.org/sample"
+ xmlns:si="http://www.schemaTest.org/sample">
+
+ <simpleType name="bytPattern">
+ <restriction base="byte">
+ <pattern value="[a-\l]"/>
+ <!--\l is not a valid single character escape. If this
+ were to be treated as a positive character group, the characters '-' and '\'
+ would have to be escaped. -->
+ </restriction>
+ </simpleType>
+
+ <simpleType name="nNIntPattern">
+ <restriction base="nonNegativeInteger">
+ <pattern value="[a--z]"/>
+ <!-- This is a positive character range character class
+ expression that contains an extra '-' character. -->
+ </restriction>
+ </simpleType>
+
+ <simpleType name="uLngPattern">
+ <restriction base="unsignedLong">
+ <pattern value="[a-Z]{0-3}"/>
+ <!-- This contain invalid quantifier -->
+ </restriction>
+ </simpleType>
+
+ <simpleType name="uIntPattern">
+ <restriction base="unsignedInt">
+ <pattern value="[a-z]{3a}"/>
+ <!-- This contain invalid quantifier -->
+ </restriction>
+ </simpleType>
+
+ <simpleType name="uBytPattern">
+ <restriction base="unsignedByte">
+ <pattern value="({(78?.9>\U>){0,,6}}\+(9)*(890765)?)*"/>
+ </restriction>
+ </simpleType>
+
+ <element name="root">
+ <complexType>
+ <sequence>
+ <element name="elPattern" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+
+
+ sample.xml
+ ==========
+ <?xml version="1.0" encoding="UTF-8"?>
+ <insi:root xmlns:insi="http://www.schemaTest.org/sample"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.schemaTest.org/sample
+ sample.xsd">
+
+ <elPattern>11111</elPattern>
+
+ </insi:root>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org