[DFDL-WG] clarification: pad/trim and nilKind='literalValue' for text numeric elements

Mike Beckerle mbeckerle.dfdl at gmail.com
Thu Oct 25 07:43:33 EDT 2012


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.


On Thu, Oct 25, 2012 at 3:13 AM, Steve Hanson <smh at uk.ibm.com> wrote:

> 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* <http://www.ogf.org/dfdl/>
> IBM SWG, Hursley, UK*
> **smh at uk.ibm.com* <smh at uk.ibm.com>
> tel:+44-1962-815848
>
>
>
> From:        Mike Beckerle <mbeckerle.dfdl at gmail.com>
> To:        dfdl-wg at 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 at 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 at 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
>



-- 
Mike Beckerle | OGF DFDL WG Co-Chair
Tel:  781-330-0412
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20121025/1fddc4da/attachment.html>


More information about the dfdl-wg mailing list