Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2285

Impossible to have nilled padded string when padChar == nilValue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • 3.0.0
    • Back End
    • None

    Description

      Imagine we have an element like this:

          <xs:element name="elem" type="xs:string"
            dfdl:lengthKind="explicit" dfdl:length="5"
            dfdl:textPadKind="padChar"
            dfdl:textTrimKind="padChar"
            dfdl:textStringPadCharacter="%SP;"
            dfdl:textStringJustification="left"
            dfdl:nilKind="literalCharacter"
            dfdl:nilValue="%SP;"
            nillable="true" />
      

      So we have a length 2, space padded string, that should also be considered nill if the entire string is made up of spaces. This does not currently work.

      I think the reason is because when when check to see if it's a nil string we first trim off all padding, which results in a zero length string. We then check to see if that string is entirely made up of the space literalCharacter. But because the string is zero length it fails. We may either need to allow zero length string, or special case when nilValue == padValue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: