Micro Focus QTP (UFT) Forums

Full Version: very urgent - XML Util throws 404 even though I access a local file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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!
Try this:

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


Is this what you are looking for?