Re: [xsl] Data extraction

Subject: Re: [xsl] Data extraction
From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Dec 2018 22:56:01 -0000
On Mon, 2018-12-17 at 17:55 +0000, Mailing Lists Mail
daktapaal@xxxxxxxxx wrote:
> Hi all
> I have a requirement where I need to write an xslt to extract a
> particular node from source tree.

If you extract snippets from the same document repeatedly, you will
probably be best off using XQuery to do it, with a database (a tree
store) as the time taken to parse the whole document will otherwise
likely dominate. In that case, //*:ElementToExtract will probably be
very fast, and (//*:ElementToExtract)[1] even faster, as David Carlisle

In XSLT, some implementations may build an element index when the
document is loaded, but not all do. Which version goes fastest will
depend on the implementation and you need to measure.

However, unless you have really large XML documents, and the time is
critical, the right question is, which version is easier to extend or
modify in the future, and for that the apply-templates version probably
wins, especially if the same pattern is used in other stylesheets you


Liam Quin,
XML/Document/Information Architecture/XSL/XQuery/Web
Text Processing and A11Y review, training & consulting.
Web slave for vintage clipart

Current Thread