G
Gerald Aichholzer
Hello NG,
I have the following XML (simplified) having a variable
number of v-elements:
<record>
<field name="parameter">
<v0>paramname0</v0>
<v1>paramname1</v1>
<v2>paramname2</v2>
</field>
<field name="parametervalue">
<v0>paramvalue0</v0>
<v1>paramvalue1</v1>
<v2>paramvalue2</v2>
</field>
<field name="parameterunit">
<v0>paramunit0</v0>
<v1>paramunit1</v1>
<v2>paramunit2</v2>
</field>
<record>
.... and would like to create the following target XML:
<record>
<field name="paramname0" value="paramvalue0" unit="paramunit0"/>
<field name="paramname1" value="paramvalue1" unit="paramunit1"/>
<field name="paramname2" value="paramvalue2" unit="paramunit2"/>
</record>
I'm working with an identity transformation and the following
templates:
<xsl:template match="record/field[@name='parameter']">
<!-- (*) -->
</xsl:template>
<xsl:template match="record/field[@name='parametervalue']"/>
<xsl:template match="record/field[@name='parameterunit']"/>
My problem is the place marked with (*):
How can I iterate over all v elements and access the homo-
nymous child in the elements for the parameter values and
units?
thanx in advance and kind regards,
Gerald
I have the following XML (simplified) having a variable
number of v-elements:
<record>
<field name="parameter">
<v0>paramname0</v0>
<v1>paramname1</v1>
<v2>paramname2</v2>
</field>
<field name="parametervalue">
<v0>paramvalue0</v0>
<v1>paramvalue1</v1>
<v2>paramvalue2</v2>
</field>
<field name="parameterunit">
<v0>paramunit0</v0>
<v1>paramunit1</v1>
<v2>paramunit2</v2>
</field>
<record>
.... and would like to create the following target XML:
<record>
<field name="paramname0" value="paramvalue0" unit="paramunit0"/>
<field name="paramname1" value="paramvalue1" unit="paramunit1"/>
<field name="paramname2" value="paramvalue2" unit="paramunit2"/>
</record>
I'm working with an identity transformation and the following
templates:
<xsl:template match="record/field[@name='parameter']">
<!-- (*) -->
</xsl:template>
<xsl:template match="record/field[@name='parametervalue']"/>
<xsl:template match="record/field[@name='parameterunit']"/>
My problem is the place marked with (*):
How can I iterate over all v elements and access the homo-
nymous child in the elements for the parameter values and
units?
thanx in advance and kind regards,
Gerald