[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Testing position of parent
Apologies for posting what will probably turn out to be a trivial problem, but I'm having a serious brain-block in spotting my mistake here. I want my template for <l> elements to impose the following test condition: if the parent is an <LG> which has first position among its siblings, then do X, otherwise do Y Here's what I thought would be the expression to accomplish that: <xsl:when test="parent::lg[position()=1]"> However, when I apply the template to something like this: <q> <lg type="quatrain"> <l>I eat my peas with honey,</l> <l>I've done it all my life;</l> <l>It makes the peas taste funny</l> <l>but it keeps them on the knife.</l> </lg> <lg type="quatrain"> <l>The boy stood on the burning deck,</l> <l>Eating peanuts by the peck;</l> <l>His mother said he would not go</l> <l>Because he loved those peanuts so.</l> </lg> </q> X gets done to every <l>, even the ones in the second <lg> that were supposed to be excluded by the test. Can someone please slap me upside the head and point out what I'm doing wrong? Paul. -- Paul Caton Electronic Publications Editor Women Writers Project e-mail: paul@xxxxxxxxxxxxxxxxxx tel: (401) 863-3619 address: Box 1841, Brown University, Providence RI 02912 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|