Hello DFDL community,

My input file first has column headings such as "name" and "line". After the 
column headings come a series of records. The first field in each record should 
be labeled by the first column heading, the second field by the second column 
header, and so forth. For example, if the column header has this:

    <columns>
        <column>
           <name>name</name>
       </column>
        <column>
           <name>line</name>
       </column>
    </columns>

Then a record would look like this:

<record>
    <name>Van Dorn Street</name>
    <line>blue</line>
</record>

How to dynamically generate an element name? I imagine something along these 
lines:

<xs:element name="record"  ...>
    <xs:complexType>
        <xs:sequence>
            <xs:element name="{get the value of ../../columns/column[1]/name}" 
.../>
            <xs:element name="{get the value of ../../columns/column[2]/name}" 
.../>
        </xs:sequence>
    </xs:complexType>
</xs:element>

Is it possible in DFDL to declare an element with a name that is the value of a 
previous field?

/Roger

Reply via email to