Working through the Javascript book "Professional Javascript for Web Developers" by Wrox, author "Zakas".
In particular I am working through his section on how to handle XML processing in Javascript.
The author gives a really good function to handle converting an XML string into a DOM object for processing,
but the book stops short on suggesting a way to handle files. Now I can handle files in two of the three cases
using:
So the question is how do I convert an XML file to a string if my browser is using DOMParser?Code:xmldom.load('myfile.xml') for IE & //The DOM 3 Load and Save ..works in Opera.. var parser = document.implementation.createLSParser(document.implementation.MODE_SYNCHRONOUS, null); //add event listener to determine when document has loaded //code here...however...the load event never fires in 9.5..So I need to address this problem also parser.parseURI('example.xml');
Because this method will only take a string:
Code:var parser = new DOMParser(); var xmldom = parser.parseFromString("<root><child/></root>", "text/xml"); // as you can see the above code only takes a string, no other options here.
thanx kevin


Reply With Quote
Bookmarks