Loadxmlerror
-
Hi, I am having some content in textfile.iam reading the content from file by using API called Read file.I convert this string to bstr using (_bstr_t)string and then i called the method LoadXML(string,bool).But when iam parsing this iam not getting output. why it is so. Thanks in advance.
-
Hi, I am having some content in textfile.iam reading the content from file by using API called Read file.I convert this string to bstr using (_bstr_t)string and then i called the method LoadXML(string,bool).But when iam parsing this iam not getting output. why it is so. Thanks in advance.
if you're using MSXML, there is a method to load an XML file given a filename, not the file's contents... look it up in the MSXML SDK
- Roman -
-
if you're using MSXML, there is a method to load an XML file given a filename, not the file's contents... look it up in the MSXML SDK
- Roman -
Try this:
Dim xml Set xml = CreateObject("MSXML2.DOMDocument") If Not WScript.Arguments.Count = 1 Then WScript.Echo "Usage: cscript loadxml.vbs <xml-file.xml>" WScript.Quit 0 End If If Not xml.load(WScript.Arguments(0)) Then WScript.Echo "The XML file couldn't be loaded:" WScript.Echo " Error: " + xml.parseError.reason + _ " Error code: 0x" + Hex(xml.parseError.errorCode) WScript.Echo " in File """ + xml.parseError.url + """" WScript.Echo " @ row "
-
Try this:
Dim xml Set xml = CreateObject("MSXML2.DOMDocument") If Not WScript.Arguments.Count = 1 Then WScript.Echo "Usage: cscript loadxml.vbs <xml-file.xml>" WScript.Quit 0 End If If Not xml.load(WScript.Arguments(0)) Then WScript.Echo "The XML file couldn't be loaded:" WScript.Echo " Error: " + xml.parseError.reason + _ " Error code: 0x" + Hex(xml.parseError.errorCode) WScript.Echo " in File """ + xml.parseError.url + """" WScript.Echo " @ row "
How'd you get that beautiful syntax highlighting? :omg:
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
-
How'd you get that beautiful syntax highlighting? :omg:
-Domenic Denicola- [CPUA 0x1337] MadHamster Creations "I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
I do it by hand X|. But I'm writing on a tool for highlighting to HTML code wich I will publish as an article ;). Guess what I can already render XML to HTML! (no XSLT, cause it reads also comments, PIs etc.) All ya need is VBS and MSXML 3. But I still need a few weeks :((.