[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] foreach, preceding-sibling::node() and following-sibl
I have a question about xsl:for-each and the usage of preceding-sibling::node() and following-sibling::node(). Here is a piece of my xml file: <abs> Experiment regarding the theory of Langevin [see Abs. <idlink>1905A01449</idlink>]. <i>in vacuo</i> and theory of the ferromagnetic state [see Abs. <idlink>1914A00343</idlink>, <idlink>1914A00344</idlink>]. </abs> I want to extract the idlink out and make it a hyperlink. So, the output will be: Experiment regarding the theory of Langevin [see Abs.<a href="url1">1905A01449</a><i>in vacuo</i> and theory of the ferromagnetic state [see Abs. <a href="url2">1914A00343</a>, <a href="url3">1914A00344</a>. But how can I get the text content between two idlink node? I used the following codes but as you can imagine, the preceding-sibling::node() keeps adding all of the content before each idlink. Do you have any experience on this subject? <xsl:when test="idlink"> <xsl:for-each select="idlink"> <xsl:copy-of select="preceding-sibling::node()"/> <xsl:variable name="idlinkVal"> <xsl:copy-of select="."/> </xsl:variable> <a href="javascript:frLink('FRLink','all', "{$idlinkVal}");"> <xsl:value-of select="$idlinkVal"/> </a> <xsl:copy-of select="following-sibling::node()"/> </xsl:for-each> </xsl:when> Thanks in advance. Ming
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|