XPath to get next node (sibling)
hello,
i'm running .net 2.0 on winxp, and am simply trying to set a variable (using an xpath query) in an xsl sheet to the name of the previous 'month' node in an xml nodeset given a month variable (ex.: "February"). the nodeset looks like the following:
<months>
<month name="January"></month>
<month name="February"></month>
<month name="March"></month>
<month name="April"></month>
...[etc]
</months>
so the desired result, passing in "February" for the variable, would be "January."
i think i need to use "preceding-sibling", but i'm not exactly sure how. i've searched a fair bit on this but can't quite seem to get the syntax right. it seems that the base query to get to the given node would be something like "months/month[@name=$month]", but from there i'm fairly lost.
can anyone help?
thanks so much in advance.
jeff
|