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

RE: Generate implicit wrapper element -- details

Subject: RE: Generate implicit wrapper element -- details
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 31 Aug 2005 13:33:47 +0100
implicit details
> I worked through this example and it worked as desired. 
> However, I am having
> trouble understanding what is happening in these matches:
> 
> <xsl:template match="li[not(preceding-sibling::*[1][self::li])]"/>

Matches an li element whose first preceding sibling is not an li element.

Start from the end: self::li selects the context node if it is an li
element, or nothing if it is not.

Within [] this node-set is converted to a boolean, so the predicate
[self::li] is true if the context node is an li element.

preceding-sibling::*[1] selects the first preceding element if there is one.

So preceding-sibling::*[1][self::li] selects the first preceding element if
there is one and it is an li element.

So not(preceding-sibling::*[1][self::li]) returns true if (a) the context
item has no preceding element, or (b) the first preceding sibling element is
not an li element.

Michael Kay
http://www.saxonica.com/


> 
> <xsl:apply-templates select="following-sibling::*[1][self::li]"
>                        mode="in-list"/>
> 
> Thanks for any explanation that you can give.
> 
> Rick Quatro
> Carmen Publishing
> 585 659-8267
> www.frameexpert.com

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.