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

Re: Find the number of elements that are prior to the

Subject: Re: Find the number of elements that are prior to the series of elements that match a string?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Mar 2019 20:31:04 -0000
Re:  Find the number of elements that are prior to the
In performance terms, of course, a solution using keys incurs a one-time cost
to build indexes, which is amortized over a number of searches; so the
performance benefits depend on whether the search is done once, or

If there are "hundreds of thousands" of Byte elements, the space used by the
index can become a significant factor.

Also, a solution using keys will almost inevitably process the whole input
sequence. Other solutions are likely to stop reading the input sequence when
the first match is found.

Michael Kay

> On 12 Mar 2019, at 20:20, Dimitre Novatchev dnovatchev@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> Here is an XSLT 2.0 solution using keys. In its current form it
> returns the wanted offset (length) as a hexadecimal number. To convert
> this to a decimal number, have a look at the archives where AFAIR
> there is such code -- could be even posted by me ... This conversion
> to decimal can certainly be written elegantly as fold-left() in
> XSLT/XPath 3

Current Thread


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.
First Name
Last Name
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.