Select correct child node
I have the follow XML, it can change but this is how I thought it will be structured.
For example, I have a value stored in a variable $VALUE that contains 200. I want check which <LOWER> and <UPPER> tags it falls in.
Once I find the matching one I want to retrieve <NAME>. So here I want to return Stage3. Can this be done in XSL?
I'm not sure how to do it.
<Stage>
<NAME>Stage1</NAME>
<LOWER>0</LOWER>
<UPPER>114</UPPER>
</Stage>
<Stage>
<NAME>Stage2</NAME>
<LOWER>115</LOWER>
<UPPER>150</UPPER>
</Stage>
<Stage>
<NAME>Stage3</NAME>
<LOWER>151</LOWER>
<UPPER>999</UPPER>
</Stage>
|