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

Re: XPath perfomance in attributes or nodes?

Subject: Re: XPath perfomance in attributes or nodes?
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Wed, 6 Mar 2002 18:52:59 -0800
xpath uid
<xsl:key name="project-uid" match="project" use="@uid"/>
<!-- or use="uid" -->
<xsl:template ...>
  <xsl:apply-templates select="key('project-uid',
     '{6A97F258-93A7-4C5E-B712-052130A5208C}')[1]"/>
  <!-- [1] is probably not necessary -->
</xsl:template>

will be much faster than either approach.

On Wednesday 06 March 2002 02:38, Arjé Cahn wrote:
> Hi everyone,
>
> Does anyone have some solid performance figures on using XPath on
> attributes or nodes?
>
> For example, I have the following XML snippet:
>
> 	<projects>
> 		<project uid="{6A97F258-93A7-4C5E-B712-052130A5208C}">
> 			<uid>{6A97F258-93A7-4C5E-B712-052130A5208C}</uid>
> 			<name>The project</name>
> 			<description>This is the project</description>
> 			<startdate>01-01-2002</startdate>
> 		</project>
> 		<project uid="{6A97F258-93A7-4C5E-B712-052130A5208D}">
> 			<uid>{6A97F258-93A7-4C5E-B712-052130A5208D}</uid>
> 			<name>Another project</name>
> 			<description>This is another project</description>
> 			<startdate>02-02-2002</startdate>
> 		</project>
> 	</projects>
>
> And I want to select a <project>.
> Is it faster using XPath
> 	projects/project[uid='{6A97F258-93A7-4C5E-B712-052130A5208C}']
> or
> 	projects/project[@uid='{6A97F258-93A7-4C5E-B712-052130A5208C}']
> or even (but this is not always possible)
> 	projects/project[name='The project']
> ???
>
> I will have about 10000+ items.
>
> Regards,
>
> Arjé Cahn
>
>
> ---------------------------------------------------------
> Content Management Department
> Hippo Webworks
> Grasweg 35
> 1031 HW Amsterdam
> The Netherlands
> Tel  +31 (0)20 6345173
> Fax +31 (0)20 6345179
> arje(at)hippo(dot)nl / www.hippo.nl
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
Peter Davis
The system was down for backups from 5am to 10am last Saturday.

 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.