Tricky! For strings we typically justify left, meaning we trim padding characters on the right, i.e., textStringJustification="left".
That means if your data is "- " or " - ", then the spaces on the right side are trimmed away before comparison against the "%WSP*;-" nilValue is done. However, for numbers we typically justify right, meaning we trim on the left, ie., textNumberJustification="right". In that case "- " or " - " would not be trimmed on the right side, but on the left, leaving them with spaces after the hyphen, so "%WSP*;-" won't match them. So, the rationale for suggesting "%WSP*;-%WSP*;" i.e., with WSP* on both sides, is so that your nilValue matching conventions are insensitive to type and to whether you use text justification of left or right. On Fri, Dec 22, 2023 at 8:01 AM Roger L Costello <coste...@mitre.org> wrote: > Hi Folks, > > > > I have a fixed-length field (3) that has hyphen as the nilValue. The > hyphen can be positioned anywhere in the field, e.g., > > > > .../- /... > > .../ - /... > > .../ -/... > > > > What is the right way to specify the nilValue? I specified it this way: > > > > dfdl:nilValue="%WSP*;-" > > > > and it seems to work just fine. > > > > But I was told, “that only allows whitespace before the hyphen; it should > be specified this way: > > > > dfdl:nilValue="%WSP*;-%WSP*;" > > > > What is the correct way? > > > > /Roger > > > > >