load v.s. loadXML

R

Richard

I have a web service that returns xml content of a file.xml as string.

I create a DOM called myDOM.
myDOM.loadXML(webreturnnode.text) this does not work.

while
myDOM.load("file.xml") works just fine..

To see the difference, I am trying to save the string into a file first and
then do the load . see if that works, but I get errors with permission etc.

StreamWriter sw = new StreamWriter("d:\\temp\\myfile.xml");
sw.Write(webreturnnode.text);
 
G

Greg Collins [InfoPath MVP]

..load = load an XML file from the file system into an XML DOM.
..loadXML = Load a string of XML code into an XML DOM.

--
Greg Collins [InfoPath MVP]
Visit http://www.InfoPathDev.com


I have a web service that returns xml content of a file.xml as string.

I create a DOM called myDOM.
myDOM.loadXML(webreturnnode.text) this does not work.

while
myDOM.load("file.xml") works just fine..

To see the difference, I am trying to save the string into a file first and
then do the load . see if that works, but I get errors with permission etc.

StreamWriter sw = new StreamWriter("d:\\temp\\myfile.xml");
sw.Write(webreturnnode.text);
 
Top