Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xmlDom.LoadXML() method failes in ASP

Status
Not open for further replies.

lawlerpat

Programmer
Jun 28, 2002
54
0
0
US
I have An ASP file in which I create two msxml2.domdocument objects. Populate one with an xml string, and the other with an xsl string. Then translate the xml using the xsl. Finally load the final translated xml into the xls object to write it to the hard drive. This seems to work in 3 out of 4 cases. The only difference in the 4 cases is that the failed case uses a <!DOCTYPE> with a dtd.
Sample Code:

Set xslDom = Server.CreateObject("MSXML2.DomDocument")
Set xmlDom = Server.CreateObject("MSXML2.DomDocument")
xmlDom.asynch = false
xslDom.asynch = false

sXML = ObjXML.XML (cstr(sURL), cstr(XMLFileName) )
xmlDom.loadXML(sXML)
xslDom.load(XSLFileName)
sXML = xmlDom.transformNode(xslDom)
xslDom.loadXML(sXML) ''This is what failes, sometimes
xslDom.save ("D:\temp\RentGrow_transmited.xml")

Here is the real irony: In additional researching I found that If I set
xsl.setProperty "ServerHTTPRequest", false
Then it works fine. Then I remove that statement and it still works. The real truth is that this code seems to work sometimes and not other times. I think that I should use teh "ServerHTTPRequest" setting but would like to know more about why I should use it and why I don't seem to need it all the time.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top