Re: External node troubles [FF3 RC1]
Boris Zbarsky <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
noon wrote: >> You're passing |doc| as the context to document.evaluate. The node passed to >> document.evaluate as the context must either be |document| or a node whose >> ownerDocument is |document|. That's pretty clearly documented in the DOM XPath >> spec. > > Maybe you're unfamiliar with the DOMParser? I've seen it a few times. See <http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/content/base/src/nsDOMParser.cpp&rev=HEAD&mark=1.64,1.52,1.47,1.45,1.44>. > parseFromString returns a > DOM document. http://www.xulplanet.com/references/objref/DOMParser.html > If I am mistaken in some way, please let me know. It returns a DOM document, sure. Please reread the paragraph you quoted above? > On another note, the replacing the rs function with the following code > works just fine in FF2 The ownerDocument check in evaluate() postdates Firefox 2. Before that the code didn't follow the spec. -Boris