Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
very urgent - XML Util throws 404 even though I access a local file
#1
Not Solved
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
Reply
#2
Not Solved
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!
Reply
#3
Not Solved
Try this:

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


Is this what you are looking for?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  XML FILE COULD NOT BE PARSED tripathy.pilu23 1 8,190 04-18-2014, 06:38 AM
Last Post: kgovadav
Rolleyes Urgent help with Gmail Sending mail feature nidhitaneja 2 2,943 03-05-2014, 09:39 PM
Last Post: nidhitaneja
  Getting an 'Error in XML document' Error when submitting web services XML luckyexpert 0 3,156 08-20-2013, 10:23 PM
Last Post: luckyexpert
  Delete and Replace nodes using vbscript in XML file SweetyChowdhury 0 4,436 04-18-2013, 01:11 PM
Last Post: SweetyChowdhury
  objbrowser.back throws general run error Wiz83 8 5,774 12-21-2012, 07:55 PM
Last Post: qtpguy0424

Forum Jump:


Users browsing this thread: 2 Guest(s)