[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|