dear All..

I have problem with MSXML..
I wanna load file to MSXML but It doesnt work..
I tried many method which finded internet.
But I failed..
I think,
although load() method return success,
If problem causes
"iXMLElm->getElementsByTagName(L"NAME", &iXMLChild);"
then it close function..


iXMLDoc->load(L"file:\\My Documents\\a.xml", &vSuccess);
if(!SUCCEEDED(hr))
AfxMessageBox(_T("LOAD FAIL.."));


iXMLDoc->get_documentElement(&iXMLElm);
iXMLElm->getElementsByTagName(L"NAME", &iXMLChild);
AfxMessageBox(_T("aaa")); //It doesnt work..
.......
.......
.......
and,,, another fail..
//CComBSTR bstrXML;
//bstrXML = XMLData; //XMLData is CString that read from file..
//iXMLDoc->loadXML(bstrXML,&tEmpty);
//iXMLDoc->loadXML((BSTR)(LPCTSTR)XMLData,&tEmpty);

but,,,
iXMLDoc->loadXML( L"<customer><NAME>Joe</NAME>"
L"<last_name>Smith</last_name></customer>",&tEmpty);
iXMLDoc->get_documentElement(&iXMLElm);
iXMLElm->getElementsByTagName(L"NAME", &iXMLChild);
AfxMessageBox(_T("aaa")); //It do work..
......
......
......

What is the best method to load xml file..?..

Re: How do I load XML file to MSXML?... by Lucian

Lucian
Tue Jul 15 01:25:40 CDT 2003

Lee C. H. wrote:
> [load xml file?]

Hi. I wrote short a technical article, plus complete source code, for
how to load an XML file using MSXML, and parse it:

http://www.codeproject.com/useritems/ce_xml.asp

--
Lucian

Re: How do I load XML file to MSXML?... by psion

psion
Tue Jul 15 02:21:57 CDT 2003

I found problem..
if XML header has
"<?xml version="1.0"?>
<package unique-identifier="">"
string..
then It doesnt work in MSXML..


psion@orgio.net (Lee C. H.) wrote in message news:<8af9155e.0307141852.4351b09e@posting.google.com>...
> dear All..
>
> I have problem with MSXML..
> I wanna load file to MSXML but It doesnt work..
> I tried many method which finded internet.
> But I failed..
> I think,
> although load() method return success,
> If problem causes
> "iXMLElm->getElementsByTagName(L"NAME", &iXMLChild);"
> then it close function..
>
>
> iXMLDoc->load(L"file:\\My Documents\\a.xml", &vSuccess);
> if(!SUCCEEDED(hr))
> AfxMessageBox(_T("LOAD FAIL.."));
>
>
> iXMLDoc->get_documentElement(&iXMLElm);
> iXMLElm->getElementsByTagName(L"NAME", &iXMLChild);
> AfxMessageBox(_T("aaa")); //It doesnt work..
> .......
> .......
> .......
> and,,, another fail..
> //CComBSTR bstrXML;
> //bstrXML = XMLData; //XMLData is CString that read from file..
> //iXMLDoc->loadXML(bstrXML,&tEmpty);
> //iXMLDoc->loadXML((BSTR)(LPCTSTR)XMLData,&tEmpty);
>
> but,,,
> iXMLDoc->loadXML( L"<customer><NAME>Joe</NAME>"
> L"<last_name>Smith</last_name></customer>",&tEmpty);
> iXMLDoc->get_documentElement(&iXMLElm);
> iXMLElm->getElementsByTagName(L"NAME", &iXMLChild);
> AfxMessageBox(_T("aaa")); //It do work..
> ......
> ......
> ......
>
> What is the best method to load xml file..?..