|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Generate implicit wrapper element -- 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
|
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
|

Cart








