Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-708

Pattern facet does not restrict a comma for a string

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Critical Critical
    • s12
    • None
    • Front End
    • None
    • Win 7 CLI 0.9.1

      If a string is constrained with a pattern facet and checkConstraint is used, it will check constraints, but it will not fail for the comma.

      For example, these examples fail for the local part:

      From: "John Doe" <john:doe@examplename.com>
      From: "John Doe" <john]doe@examplename.com>
      From: "John Doe" <john*doe@examplename.com>

      But it won't fail for this one:

      From: "John Doe" <john,doe@examplename.com>

      Here's the element I'm using:

                  <xsd:element dfdl:textStringPadCharacter="%SP;" name="LocalPart">
                      <xsd:annotation>
                          <xsd:appinfo source="http://www.ogf.org/dfdl/dfdl-1.0/">
                              <dfdl:assert test="{ dfdl:checkConstraints(.) }" message="A local part has a restricted set of allowed characters"/>
                          </xsd:appinfo>
                      </xsd:annotation>
                      <xsd:simpleType>
                          <xsd:restriction base="xsd:string">
                              <xsd:pattern value="[.A-Za-z0-9!#$%&amp;'*+-/=?^_`\{\|\}~]+"/>
                          </xsd:restriction>
                      </xsd:simpleType>
                  </xsd:element>

              jchab Jessie Chab
              james.garriss James Garriss
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: