set firstDiv = document.selectSingleNode("//div")… the paraList will contain the list of all paragraphs in the whole document, not just the list of paragraphs in the DIV on which the selectNodes call was executed.
set paraList = firstDiv.selectNodes("//p")
XPATH expressions in MSXML selectNodes() function are evaluated on the whole DOM tree
The selectNodes() function available in the Microsoft XML (MSXML) API evaluates the XPATH expressions supplied as the argument in the context of the whole DOM tree to which the DOM node belongs, not just the node on which the selectNodes function was executed. For example, if you use the following code …
Related Posts by Categories
Subscribe to:
Post Comments (Atom)
2 comments:
Sure
set paraList = firstDiv.selectNodes("p")
Sure. I know that.
I probably wanted to get all the P nodes in DIV. I could have used the descendant:: axis, but thought the XPATH expression would be evaluated in the context of the node on which it was called.
Post a Comment