[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Extracting text between nodes

Subject: Re: Extracting text between nodes
From: "Sam Byland" <shbyland@xxxxxxxxxxx>
Date: Wed, 13 Feb 2008 21:12:59 -0500
Re:  Extracting text between nodes
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]"/>


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?


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.