Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Select Nodes from Selected Nodes

From: rdcpro@-----------.---------.---
To: NULL
Date: 1/5/2005 5:55:00 PM
You can query each node in the selectNodes() nodelist one at a time, but not 
the nodelist as a whole. 

To be honest, I think XSLT would be faster.  I've recently played around 
with a fairly large XML document (several MB), and tried several methods of 
processing nodes.  One selects a nodelist and passes it as a parameter to an 
XSLT, which then processes the nodelist.  This is quite a bit faster than 
iterating over the same nodelist using DOM methods.

A faster method passed the whole DOM to the XSLT, and I set several 
parameters, using xslProc.addParameter() with the filter criteria.  This 
worked fairly well even on large numbers of nodes.

The fastest method I found was to pass the whole DOM to the XSLT, and then 
pass a query string as a parameter to the XSLT.  The query string was parsed 
in a recursive template inside, and the results used to filter the original 
XML.  I was quite surprised how fast this was.

If the end result of this process is to generate an HTML page, then I'd 
*definitely* use XSLT for this.  Even if the goal is to process a set of 
nodes, and produce some other XML document, it's probably faster to use an 
identity transformation as your starting point, and do the filtering in the 
XSLT.

What platform are you doing this in?  Is this in Javascript in an InfoPath 
document?  

Regards,
Mike Sharp


"Greg Collins [InfoPath MVP]" wrote:

> I did a search on the newsgroup and couldn't find an answer to this...
> 
> I have a fairly large DOM that I'm am doing a series of 6 complex selectNodes on. It takes quites a number of seconds to complete.
> 
> Only 2 of the 6 calls need to be over the entire DOM. The next set only needs to query the original set of selected nodes, and the third set only needs to query the second query.
> 
> In other words, I need to do:
> 
> 1. Query entire DOM
> 2. Query results of #1.
> 3. Query results of #2.
> 
> 4. Query entire DOM.
> 5. Query results of #4.
> 6. Query results of #5.
> 
> I could cut out quite a bit of time if I were able to do a selectNodes on the previously selected Nodes. As far as I can tell this is not possible. It could also be faster if I could convert the results of a selectNodes into a document that I could then, once again, do a selectNodes on.
> 
> Are either of these possible without looping through some code?
> 
> -- 
> Greg Collins [InfoPath MVP]
> Please visit: http://www.InfoPathDev.com
> 
> 
> 
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent