Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Select Nodes from Selected Nodes >Thread Next - Re: Select Nodes from Selected Nodes RE: Select Nodes from Selected NodesTo: 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 > > > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
