RE: [xsl] Double processing

Subject: RE: [xsl] Double processing
From: "Norma Yeazell" <Nyeazell@xxxxxxxxx>
Date: Fri, 30 Jan 2004 14:27:40 -0500
That did the trick!  Thanks a lot that was making me crazy! 

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of G. Ken
Holman
Sent: Friday, January 30, 2004 2:12 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Double processing

At 2004-01-30 13:25 -0500, you wrote:
>What I'm trying to do is: if there is more than one consecutive warning

>the first para of each warning needs a bullet. This is working but once

>it processes that, it repeats the second and third warning again and 
>then the third one again before continuing.
>...
><xsl:template name="warning-list">
>...
>         <xsl:variable name="next" select="following-sibling::*[1]"/>
>             <xsl:for-each select="$next[self::warning]">
>                 <xsl:call-template name="warning-list"/>

The above will process all warnings, one at a time, walking to each
immediately following sibling until there are no immediately following
sibling warnings.

><xsl:template match="warning">

This fires for all warnings.

><xsl:choose>
><xsl:when test="following-sibling::warning">

And looks at *all* following siblings for *any* warnings, not just the
immediately following sibling ...

>     <fo:block text-indent="2cm" font-weight="bold" font-size="12pt"
>text-decoration="underline" text-align="center"
>keep-with-next.within-page="always"
>keep-with-previous.within-page="always" space-after="4mm">
>         <xsl:text>WARNINGS</xsl:text>
>     </fo:block>
>         <fo:block>
>             <xsl:call-template name="warning-list"/>

... and displays all adjacent siblings.

>Can anyone tell me how to
>get it to stop after the last warning in a group and move on? I'm
stuck.

Perhaps if your first <xsl:when> in your choose was something along the
lines of "do nothing for preceding-sibling::*[1][self::warning]" using
an empty template since the warning being processed would already have
been processed the first time around?

I hope this helps.

........................... Ken

--
Public courses: sign up for one or both soon to reserve your seat!
Each week:  Monday-Wednesday: XSLT/XPath;  Thursday-Friday: XSL-FO
Washington, DC: 2004-03-15           San Francisco, CA: 2004-03-22
Hong Kong, China: 2004-05-17           Bremen, Germany: 2004-05-24
World-wide on-site corporate, government & user group XML training

G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Confidentiality Notice
The information contained in this e-mail is confidential and intended for use only by the person(s) or organization listed in the address. If you have received this communication in error, please contact the sender at O'Neil & Associates, Inc., immediately. Any copying, dissemination, or distribution of this communication, other than by the intended recipient, is strictly prohibited.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread