[DFDL-WG] DFDL character entities in DFDL expressions

Steve Hanson smh at uk.ibm.com
Wed Dec 5 06:06:38 EST 2012


Aren't XPath facilities sufficient here?

outputValueCalc="{   if (fn:string-length(../s) lt 64) then 
fn:concat(../s, xs:string(xs:hexBinary('00'))) else ../s   }" 

Regards

Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh at uk.ibm.com
tel:+44-1962-815848



From:   Tim Kimber/UK/IBM at IBMGB
To:     Mike Beckerle <mbeckerle.dfdl at gmail.com>, 
Cc:     dfdl-wg at ogf.org, dfdl-wg-bounces at ogf.org
Date:   05/12/2012 10:51
Subject:        Re: [DFDL-WG] DFDL character entities in DFDL expressions
Sent by:        dfdl-wg-bounces at ogf.org



I think the restriction was aimed at avoiding things like this: 

outputValueCalc="{   if (fn:string-length(../s) lt 64) then 
fn:concat(../s, '%#rFF;') else ../s   }" 

I agree that a total ban is too restrictive. My personal preference would 
be for the dfdl:string() function because it makes the usage of 
DFDL-specific features obvious in the DFDL expression. But what would be 
the return type of dfdl:string()? It it returned a sequence of characters 
then the raw byte entity ( %#rnn; ) would still need to be disallowed. 
regards,

Tim Kimber, DFDL Team,
Hursley, UK
Internet:  kimbert at uk.ibm.com
Tel. 01962-816742 
Internal tel. 37246742




From:        Mike Beckerle <mbeckerle.dfdl at gmail.com> 
To:        dfdl-wg at ogf.org, 
Date:        04/12/2012 23:36 
Subject:        [DFDL-WG] DFDL character entities in DFDL expressions 
Sent by:        dfdl-wg-bounces at ogf.org 




We currently have this language in the spec:

"Within an expression, a string is never interpreted as a DFDL string 
literal."

To me this means one cannot use DFDL character entities in an expression.

However, I need to do this:

         outputValueCalc="{   if (fn:string-length(../s) lt 64) then 
fn:concat(../s, '%NUL;') else ../s   }"

Basically, I need to append a NUL on the end of the string in the output 
value case.

Unless I can put a %NUL; into an expression and have it interpreted as a 
DFDL String literal,  I am not sure how I can achieve this. 

At minimum I need a new DFDL function which might be an alternate string 
constructor, such as dfdl:string('....') which interprets the argument as 
something where the contents are to be scanned for DFDL character entities 
and they are substituted so that the resulting string can contain the 
characters that are disallowed in XML. (like NUL)

-- 
Mike Beckerle | OGF DFDL WG Co-Chair | Tresys Technologies
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
--
  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20121205/c4bd5dbd/attachment-0001.html>


More information about the dfdl-wg mailing list