posted 21 years ago
I have the following XML:
<root>
<batch>
<name>batch 1</name>
<instanceList>
<instance>
<name>inst 1</name>
<value>1</value>
</instance>
<instance>
<name>inst 2></name>
<value>2</value>
</instance>
</instanceList>
</batch>
...
</root>
Part of my xsl is like:
<xsl:template match="instance">
<tr>
<td>Parent batch id</td>
<td>Don't know how to get the parent batch name!!</td>
</tr>
<tr>
<td>instance name</td>
<td>
<xsl:value-of select="name" />
</td>
</tr>
<tr>
<td>value</td>
<td>
<xsl:value-of select="value" />
</td>
</tr>
</xsl:template>
My question is: how do I get the parent "batch" node name when I am processing the "instance" node? Thanks in advance.
Liang