[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] A compelling use case for employing binary trees in XML processing?


Subject: Re: [xsl] A compelling use case for employing binary trees in XML processing?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sun, 09 Dec 2012 22:56:25 +0000

With xsl:sort you can get all the transactions in date order.

With xsl:key you can get the transactions for a specific date.

If you want all the transactions from 2012-04-15 to 2012-05-15, then neither keys nor sort is well suited, and a simple filter could be very inefficient. But binary trees will handle this well.

Michael Kay
Saxonica

On 09/12/2012 22:49, Costello, Roger L. wrote:
Hi Folks,

Dimitre has created a beautiful set of functions for building binary trees [1].

I understand that binary trees can be used to sort data. But XSLT already has <xsl:sort>, so using binary trees for sorting isn't a particularly compelling use case.

I am seeking a compelling use case for binary trees -- given XML document foo.xml and processing requirement P, a binary tree is ideally suited.

Would you provide a simple, compelling use case please?

/Roger

[1] http://dnovatchev.wordpress.com/2012/01/09/the-binary-search-tree-data-structurehaving-fun-with-xpath-3-0/


Current Thread
Keywords