You could use an expression to test if the value is greater than zero or
not which would return true or false, and concat the result, then use
true/false in your branch key. It also might be a good idea to put a
separator in between the concatenated numbers just to ensure there
aren't any ambiguities and also make the key a little more clear. For
example:
<xs:choicedfdl:choiceDispatchKey="{
fn:concat(Hidden_Storage_Class,
'.',
Hidden_Complex_Type,
'.',
Hidden_Section_Number gt 0) }">
Then your choiceBranchKey would be something like:
<xs:elementref="Function_Definition"
dfdl:choiceBranchKey="2.32.true" />
<xs:elementref="Something_Else"
dfdl:choiceBranchKey="2.32.false" />
On 1/30/19 4:42 PM, Costello, Roger L. wrote:
> Hello DFDL community,
>
> The EXE format has something called an auxiliary record. There are different
> kinds of auxiliary records. Which kind it is may depend on multiple fields.
> For
> example,
>
> An auxiliary record marks the beginning of a function definition if it has
> all
> of the following: a storage class of EXTERNAL (2), a Type value that
> indicates
> it is a function (0x20), and a section number that is greater than zero.
>
> In other words, I want to create a <Function_Definition> element if:
>
> ./Hidden_Storage_Class equals 2
>
> ./Hidden_Type equals 32
>
> ./Hidden_Section_Number is greater than 0
>
> That last one is a challenge (Hidden_Section_Number is greater than 0).
>
> Originally I thought I could create a composite key by concatenating the 3
> values:
>
> <xs:choicedfdl:choiceDispatchKey="{ fn:concat(Hidden_Storage_Class,
>
>
> Hidden_Complex_Type,
>
> Hidden_Section_Number) }">
> <xs:elementref="Function_Definition"dfdl:choiceBranchKey="???"/>
>
> But I don’t know how to set dfdl:choiceBranchKey, given that
> Hidden_Section_Number can be any number greater than zero.
>
> Any suggestions on how to express the choice?
>
> /Roger
>