xsl-list
[Top] [All Lists]

Re: [xsl] Data extraction

2018-12-18 00:59:16
Thanks Peter and Liam.
The xslt was being used in the java code.
I don't own that module , but just gave my two cents on the alternate
version.
Thanks again for all your inputs.
Dr.Pal

On Mon, Dec 17, 2018, 5:56 PM Liam R. E. Quin liam(_at_)fromoldbooks(_dot_)org <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com wrote:

On Mon, 2018-12-17 at 17:55 +0000, Mailing Lists Mail
daktapaal(_at_)gmail(_dot_)com 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/


--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>