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

RE: Finding immediately preceding node -- solved.

Subject: RE: Finding immediately preceding node -- solved.
From: Betty Harvey <betty@xxxxxxxxxx>
Date: Mon, 2 Jun 2003 14:41:47 -0400 (EDT)
what does prece mean
I finally got it work.  I abandoned for-each and went back to
original template and this worked:

<xsl:template match="c">
   <xsl:when test="@name='cde'">
       <xsl:choose>
           <xsl:when test="../preceding-sibling::b[1]/@name='abc'">
                <!-- Do something -->
           </xsl:when>
           <xsl:otherwise>
                <!-- Do something else -->
            </xsl:otherwise>
       </xsl:choose>
       <xsl:apply-templates/>
</xsl:template>

Thanks for everyones help!

Betty

On Mon, 2 Jun 2003, Passin, Tom wrote:

> [ Betty Harvey]
> > 
> > I want to get the a true when I am inside <b name="cde"> and
> > the preceding <b> contains the attribute 'name="abc"'.  
> > 
> > <a>
> >   <b name="abc"/>
> >      <c/>
> >   <b>
> >      <c/>
> >   </b>
> >   <b name="abc">
> >      <c/>
> >   </b>
> >   <b name="cde">
> >     <c/>
> > ...
> 
> Betty, what do you mean here?  By "inside", do you mean that a template
> is processing a child of a b element?  Could it also be processing a "b"
> element?  Could there be other children of a "b" besides just a "c"?
> Can these other elements be nested within a "c" or one of the other
> children?  In other words, how deep does "inside" go?  Do you always
> need to know for any template that processes a child of b, or just for
> certain ones?
> 
> 
> Can you dispatch to different templates depending on the b's preceding
> "b" sibling?
> 
> Tell us more!
> 
> Cheers,
> 
> Tom P
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


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.