Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Select Nodes from Selected Nodes

From: "Greg Collins [InfoPath MVP]" <Greg.Collins_AT_InfoPathDev.com>
To: 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
>


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