Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - RE: Select Nodes from Selected Nodes >Thread Next - Re: Select Nodes from Selected Nodes Re: Select Nodes from Selected NodesTo: NULL Date: 1/5/2005 6:19:00 PM I didn't get to read your whole response as I have to take off for the = day, but to answer your last question: this is JavaScript in InfoPath. --=20 Greg Collins [InfoPath MVP] Please visit: http://www.InfoPathDev.com "rdcpro" <rdcpro@d...> wrote in message = news:8D62987D-19DF-4E56-AD6D-2BFAD2B96E5D@m...... You can query each node in the selectNodes() nodelist one at a time, but = not=20 the nodelist as a whole.=20 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=20 processing nodes. One selects a nodelist and passes it as a parameter = to an=20 XSLT, which then processes the nodelist. This is quite a bit faster = than=20 iterating over the same nodelist using DOM methods. A faster method passed the whole DOM to the XSLT, and I set several=20 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=20 pass a query string as a parameter to the XSLT. The query string was = parsed=20 in a recursive template inside, and the results used to filter the = original=20 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=20 *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=20 identity transformation as your starting point, and do the filtering in = the=20 XSLT. What platform are you doing this in? Is this in Javascript in an = InfoPath=20 document? =20 Regards, Mike Sharp "Greg Collins [InfoPath MVP]" wrote: > I did a search on the newsgroup and couldn't find an answer to this... >=20 > 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. >=20 > 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. >=20 > In other words, I need to do: >=20 > 1. Query entire DOM > 2. Query results of #1. > 3. Query results of #2. >=20 > 4. Query entire DOM. > 5. Query results of #4. > 6. Query results of #5. >=20 > 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. >=20 > Are either of these possible without looping through some code? >=20 > --=20 > Greg Collins [InfoPath MVP] > Please visit: http://www.InfoPathDev.com >=20 >=20 >=20 > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
