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

Re: Data extraction

Subject: Re: Data extraction
From: "Peter Flynn peter@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Dec 2018 22:23:18 -0000
Re:  Data extraction
On 17/12/2018 17:54, 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.
> 
> 
> Someone wrote an xslt that looked like this.. pseudo code
> 
> Template Match node()|@*
> B  Apply-template select node()|@*
> 
> Template match *:ElementToExtract
> B  B  Copy of select .
> 
> I thought the developer was making a lot of traversing using the above
> approach and he could have instead doneB 
> 
> Template match "/"
> B  B Copy of select descendant::*:ElementToExtract

1. Is the ElementToExtract known to be unique within the document?
Or is your pseudocode masking a more extensive XPath expression to
identify the document?

2. Is this occurring within a pipeline or script? That is, does the
extracted value get passed into some subsequent process as a parameter,
or slotted into some larger data structure for reprocessing? The reason
I ask is that there are simpler tools (eg lxgrep or lxprintf) which can
do a similar task (although the LTxml2 tools are restricted to XPath 1),
eg

lxgrep 'XPath/to/ElementToExtract[predicate]' filename or stdin

Depending on the circumstances, this may be faster if the only
requirement is to extract the identified element in its serialised form.

Peter

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.