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

Re: Testing position of parent

Subject: Re: Testing position of parent
From: dkarr@xxxxxxxx (David M. Karr)
Date: 26 Oct 2000 09:48:41 -0700
david m karr
>>>>> "Kay" == Kay Michael <Michael.Kay@xxxxxxx> writes:

  >> if the parent is an <LG> which has first position among its
  >> siblings, then do X, otherwise do Y

  Kay> Try test="parent::lg[not(preceding-sibling::*)]"
  >> 
  >> Here's what I thought would be the expression to accomplish that:
  >> 
  >> <xsl:when test="parent::lg[position()=1]">

  Kay> This looks at its position among all the parent::lg elements of the current
  Kay> node

I always find it interesting to compare your responses with what David
Carlisle says.  Considering how obtuse test and path expressions can
be to newbies (which I still count myself), it's amazing how often
your two answers are almost identical.  However, on this question I
notice that your suggestion is slightly different from David's
suggestion.  I believe they will return the same result, but I'm
wondering if there's any tradeoffs to each approach.

You said:      test="parent::lg[not(preceding-sibling::*)]"
David C. said: test="not(parent::lg[preceding-sibling::*])"

Will there be any performance or other tradeoffs to these two
expressions?  Are there any general guidelines for understanding the
performance differences between two expressions like these?

-- 
===============================================================================
David M. Karr     ; dkarr@xxxxxxxx  ; w:(425)487-8312 ; TCSI & Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (#12004)


 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.