[thelist] Firefox 1.5 and XML

Matt Warden mwarden at gmail.com
Sun Feb 19 13:35:11 CST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Schmidt wrote:
> Help was on its way fast!  Thank you for your assistance.
> 
> I had assumed I had a valid XML file, as when I open it with either browser
> it gets displayed with no errors.
> I added these alerts and got the following:
> xmlDoc.nodeType = 9
> xmlDoc.tagName = undefined
> xmlDoc.innerHTML = undefined
> xmlDoc.documentElement = null
> 
> I also tried to see what would happen if I used
> nodes = xmlDoc.childNodes
> While this did not produce any errors, accessing its length with
> (nodes.length) gave me zero, not quite what I had hoped for.

Maybe not what you had hoped for, but I believe exactly what it should
produce. I don't think your XML document has loaded when you are testing it.

try this:

xmlDoc= document.implementation.createDocument("","",null)
// or .addEventListener("load", handlXMLload, false);
xmlDoc.onload = handleXMLload;
xmlDoc.load(xmlFile)

function handleXMLload() {
	alert(xmlDoc.childNodes.length);
}

hth,

- --
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD+MhvrI3LObhzHRMRAq9sAJ0a0Vz0XnzLnvQ4xkjHYn+su7tWAACg3VxC
eu7PI3NBlIsdWyFMEk61d6Q=
=y63o
-----END PGP SIGNATURE-----



More information about the thelist mailing list