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

Re: Data extraction

Subject: Re: Data extraction
From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Dec 2018 22:56:01 -0000
Re:  Data extraction
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
noted.

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
use.

Liam


-- 
Liam Quin, https://www.holoweb.net/liam/
XML/Document/Information Architecture/XSL/XQuery/Web
Text Processing and A11Y review, training & consulting.
Web slave for vintage clipart http://www.fromoldbooks.org/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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