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

RE: Apply-templates

Subject: RE: Apply-templates
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Thu, 16 Dec 1999 10:27:29 -0700
RE: Apply-templates
> I have a question
> Is it possible, when you apply-templates, to decide that
> it should apply from position()=3 and out the siblings.
> 
> XML:
> <section>
>  <item>I am item number 1</item>
>  <item>I am item number 2</item>
>  <item>I am item number 3</item>
>  <item>I am item number 4</item>
> </section>
> 
> XSL:
> <xsl:template match="section">
>  <xsl:apply-templates 
	select="following-sibling::item[position() = 3]">
> </xsl:template>

Close. You are selecting an empty node-set.
What you wrote is equivalent to:

select="./following-sibling::item[position() = 3]"

...in other words, you are trying to choose siblings
of the context node (the element 'section'). What
you want is the third child.

select="child::item[position() = 3]"

should work... or even further abbreviated

select="item[3]"


 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.