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.
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.