You need to use the dfdl:encodeDFDLEntities() function, e.g.:

<xs:choice dfdl:choiceDispatchKey="{ dfdl:encodeDFDLEntities(Subsection_Code) }">

From the spec:

Use dfdl:encodeDFDLEntities() when the value of a DFDL property is
obtained from the data stream using an expression, and the type of
the property is DFDL String Literal or List of DFDL String Literals,
and the values extracted from the data stream can contain '%' or
space characters. If the data already contains DFDL entities, this
function should not be used.


On 2023-12-22 01:00 PM, Roger L Costello wrote:
Hi Folks,

I am reading a subsection code (1 character) into this element:

<xs:elementname="Subsection_Code"type="xs:string"
                     dfdl:lengthKind="explicit"dfdl:length="1"/>

Some subsection codes are the blank character.

Then I use choiceDispatchKey on that element that holds the subsection code:


<xs:choicedfdl:choiceDispatchKey="{*Subsection_Code*}">

I get this error message when I run my DFDL schema:

*Schema Definition Error: For choiceDispatchKey, the string ( ) must not contain any whitespace. Use DFDL Entities for whitespace characters.*

Is there a workaround?

/Roger


Reply via email to