Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with creating an XML file
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi.
I was trying to create an XML file through QTP using XMLUtil, i managed to create the XML except for one problem, the file is created without the XML declaration, i can't figure out how to add the xml declaration to the file.
Anyone knows?
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
You can use 'AddDeclaration' method. This will add the xml declaration to your xml doc.
see the code below
Code:
Set oXML = XMLUtil.CreateXML
oXML.Loadfile "C:\books.xml" 'replace with your xml path
oXML.AddDeclaration "1.0","UTF-8","no"
oXML.SaveFile  "C:\books.xml" 'replace with your xml path

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help in creating dynamic object string using Childobjects Keshub Mathur 0 1,510 09-11-2017, 05:52 PM
Last Post: Keshub Mathur
  XML FILE COULD NOT BE PARSED tripathy.pilu23 1 7,819 04-18-2014, 06:38 AM
Last Post: kgovadav
  HAVING PROBLEM IN CREATING OBJECT OF TEST BATCH RUNNER mayankchauhan 0 3,321 04-04-2014, 05:29 PM
Last Post: mayankchauhan
  Getting an 'Error in XML document' Error when submitting web services XML luckyexpert 0 2,935 08-20-2013, 10:23 PM
Last Post: luckyexpert
  Creating a folder from within a reusable action. sd3 2 2,991 06-18-2013, 03:20 PM
Last Post: learnQtptips

Forum Jump:


Users browsing this thread: 1 Guest(s)