kiki@dyky.co.uk wrote:
[color=blue]
> var xml = "<input><selectedGame>Domino</selectedGame></input>"
> var oParamXML= document.implementation.createDocument("","",null) ;
> oParamXML.load(xml);[/color]
That is nonsense, Mozilla implements a method called load but that takes
a URI and not a string with XML as the argument. So load(xml) does not
make sense with xml being a string.
You probably want
var xmlDocument = new DOMParser().parseFromString(
xml,
'application/xml'
);
[color=blue]
> in IE i'd do oParamXML.xml to view the loaded xml. What's the equiv in
> Mozilla, or is there a way to view it?[/color]
If you want to serialize an XML DOM node in Mozilla (and Opera) you can
use XMLSerializer e.g.
var serializedXML = new XMLSerializer().serializeToString(xmlDocument);
See also
<http://www.faqts.com/knowledge_base/index.phtml/fid/616>
with entries
<http://www.faqts.com/knowledge_base/view.phtml/aid/15302/fid/616>
<http://www.faqts.com/knowledge_base/view.phtml/aid/34646/fid/616>
--
Martin Honnen
http://JavaScript.FAQTs.com/