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

Re: using normalize-space with mixed element content

Subject: Re: using normalize-space with mixed element content
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 09 Jun 2010 00:10:53 +0100
Re:  using normalize-space with mixed element content
On 08/06/2010 23:52, Imsieke, Gerrit, le-tex wrote:
If you want to treat the first / last text nodes of article-title, no
matter how deep they are nested in other elements:

<xsl:template match="article-title//text()[
generate-id() eq (
for $t in ancestor::article-title//text()
return generate-id($t)

you don't need to compare id strings in xpath2 as you can use is

 <xsl:template match="article-title//text()[
 . is(ancestor::article-title//text())[last()]

which is a long way of writing

<xsl:template match="article-title/descendant::text()[last()]"/>

except you can't use descendant axis in a pattern: grrr

except the plan is you can in xslt 2.1: yay!


except there are too many changes to call this 2.1, should be 1.0, 5th edition: booo



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.