I have a large XML files that repeats the following XML:
-
-
<script>
-
<action>
-
<actions>
-
<postdata>
-
<input type="Data">
-
<parameter name="Name">
-
<variable type="Static">
-
<![CDATA[trans]]>
-
</variable>
-
<parameter name="Value">
-
<variable type="Static">
-
<![CDATA[hello]]>
-
</variable>
-
</input>
-
<input type="Data">
-
<parameter name="Name">
-
<variable type="Static">
-
<![CDATA[site]]>
-
</variable>
-
<parameter name="Value">
-
<variable type="Static">
-
<![CDATA[joe]]>
-
</variable>
-
</input>
-
-
......
-
I have written the following xsl which pulls it but the XPATH is hardcoded:
-
<xsl:value-of select="//script/actions/action/postdata/input[@type = 'Data'][2]/parameter[@name = 'Value']"</xsl:value-of>
-
Each XML file is the same but the "<input></input>" order could be different so I really need the "<parameter name="Value"> CDATA value which is "joe" but this will be different every time. I was trying to look for the "<parameter name="Name">" CDATA value which is "site" because this is consistent and grab the "following::sibling" possibly.
I hope this makes more sense.
Thanks again,
Todd