|
[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: finding the first element of a specific type
Subject: Re: finding the first element of a specific type
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Mon, 26 May 2003 21:10:02 +0200
|
Jon Steeves wrote:
Hello:
Here's my code:
<xsl:variable name="printable_register1" select="//register
[@status ='direct' or @status='reserve'][1]"/>
<xsl:template match="register">
<xsl:choose>
<xsl:when test="generate-id(self::*)=generate-id($printable_register1)">
... do stuff
I want to find the first register that has either "direct" or "reserve"
status so that there will be no page break printed when that and only that
one is output. But it ain't working. Can anyone help me.
I'd try the preceding axis:
<xsl:template match="register">
<xsl:choose>
<xsl:when test="not(preceding::register[@status
='direct' or @status='reserve'])">
...
BTW without testing it specifically I'd say your approach
should work too, although it's a bit...unconventional
(for example, most people tend to use . instead of self::*).
J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
|
| Atom 0.3 |
|
|