By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,567 Members | 1,522 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,567 IT Pros & Developers. It's quick & easy.

Firefox1.5: DOMParser.parseFromString() returns "[Document] null"

P: n/a
Hi All,

The following code returns a valid xmlDoc (since I can evaluate and
selectNodes) but its value is "xmlDoc=[Document] null" ?! Or at least
this is what the FireBug shows and (xmlDoc===null) is true.

var parser = new DOMParser();
var xmlDoc = parser.parseFromString( responseText, "text/xml");
// at this point: xmlDoc=[Document] null

I'm a bit lost on what this actually means..

Any ideas?

Regards,
Sebastian

Jul 7 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a


sf****@gmail.com wrote:

var parser = new DOMParser();
var xmlDoc = parser.parseFromString( responseText, "text/xml");
// at this point: xmlDoc=[Document] null
It might be that the output your tool shows you is first the name of the
variable, then its toString() result (which is [Document] so you have a
DOM Document there), then perhaps its nodeValue (which is null by
definition for document nodes).
But I am guessing, ask in a FireBug forum, I don't think that
alert(xmlDoc === null) will show true so that null must have some other
cause.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 7 '06 #2

P: n/a
Martin Honnen wrote:
var parser = new DOMParser();
var xmlDoc = parser.parseFromString( responseText, "text/xml");
// at this point: xmlDoc=[Document] null

It might be that the output your tool shows you is first the name of the
variable, then its toString() result (which is [Document] so you have a
DOM Document there), then perhaps its nodeValue (which is null by
definition for document nodes).
But I am guessing, ask in a FireBug forum, I don't think that
alert(xmlDoc === null) will show true so that null must have some other
cause.
Thanks Martin,

That was indeed the case.

Regards,
Sebastian

Jul 12 '06 #3

P: n/a
Martin Honnen wrote:
var parser = new DOMParser();
var xmlDoc = parser.parseFromString( responseText, "text/xml");
// at this point: xmlDoc=[Document] null

It might be that the output your tool shows you is first the name of the
variable, then its toString() result (which is [Document] so you have a
DOM Document there), then perhaps its nodeValue (which is null by
definition for document nodes).
But I am guessing, ask in a FireBug forum, I don't think that
alert(xmlDoc === null) will show true so that null must have some other
cause.
Thanks Martin,

That was indeed the case.

Regards,
Sebastian

Jul 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.