Ok, I agree this is what the spec says now, and is at least a predictable behavior.
I will likely dodge the issue about left/right padding by using nilValue="%WSP*;-%WSP*;"
This will parse as "- ", but unparse as " -", but that's fine with me for now.
The dfdl:textNumberJustification property applies to the element regardless. When parsing and nilLiteralValue, trimming takes place before the value is examined for nil value. (That rule enables a nilValue like 'NIL' to be used in scope for many fixed length elements regardless of length).
Regards
Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh@uk.ibm.com
tel:+44-1962-815848
From: Mike Beckerle <mbeckerle.dfdl@gmail.com>
To: dfdl-wg@ogf.org,
Date: 24/10/2012 19:00
Subject: [DFDL-WG] clarification: pad/trim and nilKind='literalValue' for text numeric elements
Sent by: dfdl-wg-bounces@ogf.org
--
Consider:
<element name="e" type="xs:int" nillable="true"
dfdl:lengthKind="explicit" dfdl:length="4"
dfdl:nilValue="-"
dfdl:textPadChar="%SP;"
dfdl:textNumberJustification="right"
dfdl:representation="text"/>
Is a nil justified on the right, or are only number values justified on the right?
That is, will [- ] be interpreted as nil, or only [ -]
A literal nil value is effectively textual syntax, and has nothing to do with whether the field is number or string,
so one might legitimately say that textStringJustification applies to it.
But then again....
--
Mike Beckerle | OGF DFDL WG Co-Chair
Tel: 781-330-0412
dfdl-wg mailing list
dfdl-wg@ogf.org
https://www.ogf.org/mailman/listinfo/dfdl-wg
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU