xsl-list
[Top] [All Lists]

Re: selecting all text between two nodes

2005-09-07 00:41:22
Hi,

Tempore 07:11:11, die 09/07/2005 AD, hinc in 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Lynn Alford 
<lynn(_dot_)alford(_at_)jcu(_dot_)edu(_dot_)au>:

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>


regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Gaudiam omnibus traderat W3C, nec vana fides

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>