[XPATH] query problem with siblings
Posted on 2006-11-13
I'm a bit lost. If I take the previous xml data, how can I get the following-sibling of the element with @id="734"? Using /data/following-sibling::record[@id='734'] doesn't work obviously, as it takes out that one record with id=734, and that sub-recordset doesn't have any siblings.
I could loop through all records until I find the right id, and then I can use the following-sibling, like below. I would have to do this twice, for the preceding-sibling as well.
<xsl:if test="@id='734'"><xsl:value-of select="following-sibling::*"/></xsl:if>
Isn't there a more direct way?