Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: passing in an element as a parameter to a stylesheet >Thread Next - Re: passing in an element as a parameter to a stylesheet Re: passing in an element as a parameter to a stylesheetTo: NULL Date: 8/2/2007 8:36:00 PM Richard Tobin wrote: > In article <46b22125@kcnews01>, > Joseph Kesselman <keshlam-nospam@c...> wrote: > >>> generate-id($a) = generate-id($b) would do. > >> That's definitely the simplest way to test is-same-node in XSLT 1.0. > > Why is it simpler than "count($a|$b)=1" ? > > I agree it may be simpler to explain. > > I believe that using generate-id() is likely to be much more expensive > in most processors, but of course this only matters when it's used > heavily. > > -- Richard this came up a while ago on xsl-list and someone (Jeni I think) did a survey of popular processors and it was about 50-50 which idiom was quicker. On saxon at that time count() was a lot faster than using generate-id, so Mike changed things so saxon special cases the generate-id($a)=generate-id($b) idiom and rewrites it to an internal form which just checks same-node without actually computing the unique id, ie it uses an internal (for xpath1) operator equivalent to xpath 2's is operator. This is of course a lot faster. Though as you say, you need to be doing a lot of them before you can really tell the difference. David -- http://dpcarlisle.blogspot.com | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
