How to Read / Write XML file using ATL COM application
- Hello every one;
How to read/write/append/modify an xml file using the ATL COM application.?
Please provide any code if possible.
Thanks in advance.
Answers
- use MSXML
in your stdafx.h
Knowledge is like light; It spreads only when you have clear and transparent mind. - Sreedhar Dv- Marked As Answer byNancy ShaoMSFT, ModeratorMonday, November 09, 2009 2:00 AM
Hi RITESH_SHINDE,
I’m agree with Sreedhar, you can use MSXML. For code, I have found some useful links, please refer to:
· Using the new ATL CString class to read XML files via MSXML
· How to use the XML Parser in ATL project ?
Best Regards,
Nancy
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byNancy ShaoMSFT, ModeratorMonday, November 09, 2009 2:00 AM
All Replies
- use MSXML
in your stdafx.h
Knowledge is like light; It spreads only when you have clear and transparent mind. - Sreedhar Dv- Marked As Answer byNancy ShaoMSFT, ModeratorMonday, November 09, 2009 2:00 AM
Hi Ritesh,
You need to decide the approach you want to select. There are two ways to do it. They are
DOM parsing.
SAX Parsing.
You can use DOM parsing for small xml files. For larger files use sax parsing. MsXML dll from microsoft provides the COM implementation for parsing. You will msxml SDK for the implementation.
DOM details
http://msdn.microsoft.com/en-us/library/ms763789(VS.85).aspx
SAX details
http://msdn.microsoft.com/en-us/library/ms757033(VS.85).aspxhttp://www.codeguru.com/cpp/data/mfc_database/xml/article.php/c11517__1/
http://xerces.apache.org/xerces-c/program-sax-3.html#UsingSAX1API
http://xerces.apache.org/xerces-c/program-3.html
Hope this helps.
Thanks
PKR.Hi RITESH_SHINDE,
I’m agree with Sreedhar, you can use MSXML. For code, I have found some useful links, please refer to:
· Using the new ATL CString class to read XML files via MSXML
· How to use the XML Parser in ATL project ?
Best Regards,
Nancy
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byNancy ShaoMSFT, ModeratorMonday, November 09, 2009 2:00 AM


