[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: selecting all text between two nodes
Hi,
Tempore 07:11:11, die 09/07/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Lynn Alford <lynn.alford@xxxxxxxxxx>: which means I want to open a ulink - copy all text that appears between the <tx.hyperlink> and the <tx.hyperlink_end> then close the ulink. I anwsered a very similar problem a few days ago (http://www.biglist.com/lists/xsl-list/archives/200509/msg00082.html) Here's a solution that will fit your demands: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:output method="xml" /> <xsl:key name="hyperlink" match="node()" use="preceding::tx.hyperlink[1]/@id [.=current()/following::tx.hyperlink_end[1]/@begin]"/> <xsl:template match="/"> <xsl:apply-templates select="//tx.hyperlink" /> </xsl:template> <xsl:template match="tx.hyperlink"> <ulink url="{locator_url/@protocol}:/{locator_url/@file_name}"> <xsl:apply-templates select="key('hyperlink',@id)"/> </ulink> </xsl:template> </xsl:stylesheet>
|
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
|