Investigation with IBM DFDL using a left justified example...

a) abcd\PPPP gives abcd.
b) abcdP\PPP gives abcdP

...and using a right justified example...

c) PPP\Pabcd gives Pabcd.
d) PP\PP gives PPabcd

This is asymmetric and is explained by blind trimming of the pad char.

However it has some merit as it is the simplest rule to devise. Trimming is blind to the semantic of any other character and simply removes the pad character until it finds another character. To avoid problems don't use the same character to both pad and delimit.  Anything else and things start to get complicated.

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:        12/11/2012 23:06
Subject:        [DFDL-WG] Clarification: can you escape a pad char with an escape        char?
Sent by:        dfdl-wg-bounces@ogf.org




Did we decide whether an escape character can precede a pad character hence, making it part of the content, not the padding?

E.g., suppose pad character is P, escape character is E.

then can 'abcdEPPPP'

be interpreted as 'abcdP' then 3 pad characters, or did we decide that padding ignores escape chars?

I think we decided that padding is outside of the escape blocks, so that

if [ and ] are my escape block start and end, then PPP[PabcP]PPP would be 'PabcP' as content.

but I don't think we commented on regular single escape character characters and pad char.

It seems consistent to me that 'abcdEPPPP' is abcdP as content.

but if not, then 'abcdEPPP' stripping off the trailing padding ends with the escape character, so the escape character is escaping nothing hence the content would be 'abcd' I believe.

Comments?

...mike

--
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