Micro Focus QTP (UFT) Forums
very urgent - XML Util throws 404 even though I access a local file - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: very urgent - XML Util throws 404 even though I access a local file (/Thread-very-urgent-XML-Util-throws-404-even-though-I-access-a-local-file)



very urgent - XML Util throws 404 even though I access a local file - ConstantChange - 04-18-2008

Hi everybody!

I need to read XML files in, and therefore found the XMLUtil object provided by QTP or Microsoft or something similar.

This is from the QTP Help:
Example
The following example creates an XML object and loads the XML file BookStore.xml into it.

Code:
Set XMLObj = XMLUtil.CreateXMLFromFile("C:\XML\BookStore.xml")



My line is
Code:
Set XMLObj = XMLUtil.CreateXMLFromFile("C:\test.xml")


The problem is: This does not work! Whenever I try this (using my file, or bookstore, whatever) I get this error:

"The remote server returned an error: (404) Not Found"

(I definately know the file exists!)

So, what is this all about? At least the error message is a bit more exact than the usual "General Run Error" Wink

Thanks!!!
Cheers,
CC


RE: very urgent - XML Util throws 404 even though I access a local file - ConstantChange - 04-18-2008

Hey, know what caused the error, the reference to the DTD at the top of the XML (the doctype part). If that is removed, I can actually read in the file.

So, does anybody know how I can turn that of, so that I dont need to alter the xml everytime I read it in??

Thanks again!


RE: very urgent - XML Util throws 404 even though I access a local file - Anshoo Arora - 05-10-2008

Try this:

Code:
Set oXML = XMLFile("C:\test.xml").GetData
sXML = oXML.ToString()
MsgBox(sXML)


Is this what you are looking for?