I am trying to extract data that is in a nested XML elements.
Here is the original XML:
I can get all the data for <timebreakdown> by using
and then
so I only get the data inside <today rowID="ff00"> to put it in a new tag in my new document. However, I only want the data for <today rowId="ff00">, it spits the rest of the elements in side the <timebreakdown> tag.
Any help would be appreciated.
Thanks!
Here is the original XML:
Code:
<cmrs>
<timeBreakdown>
<activityCodeName rowId="1600">22:RIG WATCH</activityCodeName>
<today rowId="1600" />
<well rowId="1600" />
<well rowId="1700" />
<well rowId="1800" />
<well rowId="1900" />
<activityCodeName rowId="1a00">OTHER</activityCodeName>
<today rowId="1a00">6.0</today>
<well rowId="1a00">6.0</well>
<today rowId="ff00">6</today>
<well rowId="ff00">6.0</well>
</timeBreakdown>
</cmrs>
I can get all the data for <timebreakdown> by using
Code:
<xsl:template match="cmr">
<cmr>
<xsl:apply-templates select="timebreakdown"/>
</cmr>
and then
Code:
<xsl:template match="today [@rowId='ff00']">
<TotalHours><xsl:value-of select="." /></TotalHours>
</xsl:template>
Any help would be appreciated.
Thanks!