xsl-list
[Top] [All Lists]

Re: [xsl] Extracting text between nodes

2008-02-13 19:13:44
Thank you for the reply.

Unfortunately, this line doesn't work under my xslt engine (libxslt under PHP). I guess it only supports 1.0
Any ideas?


My original reply was compatible with 1.0 as well --

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

           <xsl:output method="text"/>

           <xsl:template match="a | b[position() = 1]"/>

</xsl:stylesheet>


Which, as David noted in his post, will "lose the stuff you don't want". There are many ways to do this though, and it will depend on how the HTML will vary from the example you provided. i.e., do you only (and always) want to lose the text in the first <b> element, and all <a> elements?

...sam


--~------------------------------------------------------------------
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>
--~--