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

Re: Attributes, modes and templates [solution]

Subject: Re: Attributes, modes and templates [solution]
From: Alex Lancaster <alex@xxxxxxxxxxx>
Date: 13 May 2000 18:03:51 -0600
it solutions attributes
>>>>> "TG" == Tony Graham <tgraham@xxxxxxxxxxxxxxxx> writes:

TG> At 13 May 2000 02:55 -0600, Alex Lancaster wrote:

>> Search for the all the desired nodes `corpauthor', `fax', `author'
>> in the following example that have as _ancestors_ (arbitrarily
>> deep), a `variablelist' with the appropriate attribute set, so I
>> have templates like the following:
>> 
>> <!-- rules for role subclassing on programmer info pages -->
>> <xsl:template
>> match="variablelist[@role='programmers']//corpauthor">

TG> What about:

TG> <xsl:template 
TG>    match="corpauthor[ancestor::variablelist[@role='programmers']]">

Also sounds fine to me.  My solution definitely works, so the real
question is: what are the relative advantages/disadvantages between
these solutions?  i.e. is it going to be relatively more efficient to
process in the second way versus the first, or do the XPath
expressions (which are effectively equivalent as far as I can tell)
get "mapped" to the same underlying implementation?

Modulo the efficiency issues (which I have no expertise on), the
relative advantages I can see are:

The advantage to Tony's way is that the element in question comes
first in the template, it says "give me all the corpauthor elements
with an ancestor of variablelist with the attribute set to so-and-so",
so it's more readable and self-documenting than my solution.

The advantage to my way is that it's a shorter XPath expression.

Thanks for the suggestion!

Alex
-- 
Alex Lancaster * alex@xxxxxxxxxxx * www.santafe.edu/~alex * 505 984-8800 x242
Santa Fe Institute (www.santafe.edu) & Swarm Development Group (www.swarm.org)


 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.