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

Re: Return text contents of most recent non-null sibli

Subject: Re: Return text contents of most recent non-null sibling.
From: Michael Müller-Hillebrand <mmh@xxxxxxxxxxxxx>
Date: Tue, 14 Aug 2012 18:51:00 +0200
Re:  Return text contents of most recent non-null sibli
Hi Richard,

Your predicate just checks whether any of the preceding-sibling rows have a
first column child, you also have to check whether it is empty or not. How
about this, if you can use XPath 2:

<xsl:template match="row">
   <xsl:variable name="heading" select="column[@column eq '1']" />
   <item row="{@row}" name="{
      if ($heading != '')
      then $heading
      else preceding-sibling::row[column[@column eq '1'] !=
''][1]/column[@column eq '1']
     }" value="{column[@column eq '3']}" />
</xsl:template>

You see I also used the @column attribute to locate the correct cell but that
might be unnecessary.

Of course it would be even better to create a function like
my:GetCurrentHeading() to encapsulate the if-then-else stuff.

HTH,

- Michael


Am 14.08.2012 um 18:03 schrieb Kerry, Richard:

> <xsl:otherwise>
> <test heading="{preceding-sibling::node()[column[1]][1]/column[1]}"
type="absent" value="{column[3]}" />
> </xsl:otherwise>

--
_______________________________________________________________
Michael M|ller-Hillebrand: Dokumentations-Technologie
Adobe Certified Expert, FrameMaker
Lvsungen und Training, FrameScript, XML/XSL, Unicode
Blog: http://cap-studio.de/ - Tel. +49 (9131) 28747

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.