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

Re: Only child pattern -- XT bug or my failure?

Subject: Re: Only child pattern -- XT bug or my failure?
From: "Sebastian Rahtz" <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 7 Jun 2000 21:25:44 +0100 (BST)
date only child
Chris Powell writes:
 > I am only concerned with DOC/DIV at this point.  Some documents contain a
 > superfluous single division wrapping all the rest of the content, so I
 > want to match those DOC/DIVs.  Looking at the XSLT recommendation, I see
 > that the correct match should be DOC/DIV[last()=1].  However, when

just <xsl:template match="DOC/DIV"> does what you seem to want. it
matches any <DIV> whose parent is a <DOC>

 > documents have multiple divisions (that is, they are correctly marked up
 > with no superfluous wrapping DIV), the first DIV gets matched and the
 > template gets applied; siblings get left alone.

I can't quite get my head around [last()=1], but junk it....

Sebastian


 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.