[
https://issues.apache.org/jira/browse/DAFFODIL-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dave Thompson closed DAFFODIL-2285.
-----------------------------------
Closing as working per spec per Mike B.
> Impossible to have nilled padded string when padChar == nilValue
> ----------------------------------------------------------------
>
> Key: DAFFODIL-2285
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2285
> Project: Daffodil
> Issue Type: Bug
> Components: Back End
> Reporter: Steve Lawrence
> Priority: Major
> Fix For: 3.0.0
>
>
> Imagine we have an element like this:
> {code:xml}
> <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" />
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)