Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6977201

Validator incorrectly interprets an empty regex pattern

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.4
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        Attached a group of invalid test cases (schema + xml document). Validator interprets all of them as valid pairs.
        Example of schema:
        <xsd:element name="doc">
            <xsd:complexType>
                    <xsd:choice>
                        <xsd:element name="elem" type="Regex" minOccurs="1" maxOccurs="unbounded"/>
                    </xsd:choice>
            </xsd:complexType>
        </xsd:element>

        <xsd:simpleType name="Regex">
               <xsd:restriction base="xsd:string">
                   <xsd:pattern value=""/>
               </xsd:restriction>
        </xsd:simpleType>

        The following xml document is valid for this schema:

        <?xml version="1.0"?>
        <doc xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance&#39;
            xsi:noNamespaceSchemaLocation='reA2.xsd' >

        <!--
        base='string', pattern='', value='a', type='invalid', RULE='1'
        -->

             <elem>a</elem>

         </doc>

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                joehw Joe Wang
                Reporter:
                lkuskov Leonid Kuskov
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: