Altova Mailing List Archives


RE: [xsl] XPath perfomance in attributes or nodes?

From: "Michael Kay" <michael.h.kay@------------>
To:
Date: 3/6/2002 6:09:00 AM
The difference between your different approaches is almost certainly
negligible. Both will be much slower than using a key definition.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Arj&eacute; Cahn
> Sent: 06 March 2002 10:39
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] XPath perfomance in attributes or nodes?
>
>
> 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&eacute; 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
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.