Hello DFDL community!

I want to create a local variable; is that possible in DFDL?

For example, I would like to create a variable to hold the value of a hidden 
element and then use that variable in an inputValueCalc expression. Below I 
show the idea: I create a variable named Hidden_color_number and then use that 
variable in the inputValueCalc expression. I show creating an XSLT variable, 
which is obviously not correct. Is there a way to do this in DFDL?  /Roger

<xs:element name="enum-test">
    <xs:complexType>
        <xs:sequence>

            <xs:sequence dfdl:hiddenGroupRef="hidden_Color_Group" />

            <xsl:variable name="Hidden_color_number" 
select="../Hidden_color_number"/>

            <xs:element name='color' type='xs:string' dfdl:inputValueCalc="{
                doc('Colors.xml')//row[number eq 
xs:string($Hidden_color_number)]/symbol}" />

        </xs:sequence>
    </xs:complexType>
</xs:element>

Reply via email to