[DFDL-WG] Can I concatenate a variable?

Garriss Jr., James P. jgarriss at mitre.org
Tue Jun 25 07:14:00 EDT 2013


> 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 at ogf.org [mailto:dfdl-wg-bounces at ogf.org] On Behalf Of Tim Kimber
Sent: Monday, June 24, 2013 4:11 PM
To: dfdl-wg at 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 at uk.ibm.com<mailto:kimbert at uk.ibm.com>
Tel. 01962-816742
Internal tel. 37246742




From:        "Garriss Jr., James P." <jgarriss at mitre.org<mailto:jgarriss at mitre.org>>
To:        "dfdl-wg at ogf.org<mailto:dfdl-wg at ogf.org>" <dfdl-wg at ogf.org<mailto:dfdl-wg at ogf.org>>,
Date:        24/06/2013 20:38
Subject:        [DFDL-WG] Can I concatenate a variable?
Sent by:        dfdl-wg-bounces at ogf.org<mailto:dfdl-wg-bounces at 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 at ogf.org<mailto: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/20130625/f59a5ea8/attachment-0001.html>


More information about the dfdl-wg mailing list