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

Re: Data extraction

Subject: Re: Data extraction
From: "Mailing Lists Mail daktapaal@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Dec 2018 19:31:34 -0000
Re:  Data extraction
David,
Thanks for the reply. My apologies, i didn't give example of my XML. The
XML contains single occurance of ElementToExtract/ node. In which case I
thought that instead of going through the whole tree, jumping to the
element using descendant::*:ElementToExtract is firstly small in code and
secondly eleminating the useless node traversal ?

Wanted to validate my thought ..


On Mon, Dec 17, 2018, 2:23 PM David Carlisle d.p.carlisle@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx wrote:

> On Mon, 17 Dec 2018 at 17:54, Mailing Lists Mail daktapaal@xxxxxxxxx
> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > Hi all
> > I have a requirement where I need to write an xslt to extract a
> particular node from source tree.
> >
> >
> > Someone wrote an xslt that looked like this.. pseudo code
> >
> > Template Match node()|@*
> >   Apply-template select node()|@*
> >
> > Template match *:ElementToExtract
> >     Copy of select .
> >
> > I thought the developer was making a lot of traversing using the above
> approach and he could have instead done
> >
> > Template match "/"
> >    Copy of select descendant::*:ElementToExtract
> >
> >
> > Would you agree ? I thought this was very obviously better and faster ...
> >
> > Forgive my pseudo code.
>
> whether or not it is faster depends on the processor you are using and
> how it optimises such searches but in general they are not equivalent
> if you can have
>
> <ElementToExtract>...<ElementToExtract>zzz</ElementToExtract>...</ElementToExtract>
>
> Then the first form will return
>
> <ElementToExtract>...<ElementToExtract>zzz</ElementToExtract>...</ElementToExtract>
> and the second
>
> <ElementToExtract>...<ElementToExtract>zzz</ElementToExtract>...</ElementToExtract><ElementToExtract>zzz</ElementToExtract
>
> David
>
> >
> >
> > Dr.pal
> >
> >
> >
> >
> >
> >>
> >>
> > XSL-List info and archive
> > EasyUnsubscribe (by email)

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.