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

Testing position of parent

Subject: Testing position of parent
From: Paul Caton <paul@xxxxxxxxxxxxxxxxxx>
Date: Wed, 25 Oct 2000 11:27:51 -0400 (EDT)
eating peanuts by the peck
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


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.