> In section 12.3.5 of the specification, the 'lengthPattern' property is listed as having the type 'DFDL Regular expression'. Unlike some other properties, dfdl:lengthPattern cannot be a DFDL expression. Therefore it cannot contain a DFDL variable reference.

 

Is there no workaround for this?

 

From: dfdl-wg-bounces@ogf.org [mailto:dfdl-wg-bounces@ogf.org] On Behalf Of Tim Kimber
Sent: Monday, June 24, 2013 4:11 PM
To: dfdl-wg@ogf.org
Subject: Re: [DFDL-WG] Can I concatenate a variable?

 

Hi James,

In section 12.3.5 of the specification, the 'lengthPattern' property is listed as having the type 'DFDL Regular expression'. Unlike some other properties, dfdl:lengthPattern cannot be a DFDL expression. Therefore it cannot contain a DFDL variable reference.

On the other hand, section 14.2 lists the data type of dfdl:separator as 'List of DFDL String Literals or DFDL Expression', However, your dfdl:separator is not a valid DFDL expression. The property must be either a valid DFDL expression or a list of DFDL string literals. The syntax you need is

<xsd:sequence dfdl:separator="{fn:concat('--'),$some_boundary}" dfdl:separatorSuppressionPolicy="anyEmpty"  dfdl:terminator="--%CR;%LF;">

regards,

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




From:        "Garriss Jr., James P." <jgarriss@mitre.org>
To:        "dfdl-wg@ogf.org" <dfdl-wg@ogf.org>,
Date:        24/06/2013 20:38
Subject:        [DFDL-WG] Can I concatenate a variable?
Sent by:        dfdl-wg-bounces@ogf.org





Suppose I define a variable like this:
 
<dfdl:defineVariable name="boundary" defaultValue="some_boundary" type="xsd:string"/>
 
Can I later concatenate it with other values?  
 
For example, can I concatenate it as part of a pattern?
 
<xsd:element name="Preamble" type="xsd:string" dfdl:lengthKind="pattern" dfdl:lengthPattern="(.+?)(?=--{$some_boundary})"/>
 
Can I concatenate it as part of a separator?
 
<xsd:sequence dfdl:separator="--{$some_boundary}" dfdl:separatorSuppressionPolicy="anyEmpty"  dfdl:terminator="--%CR;%LF;">
 
TIA!--
 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