Click here to Skip to main content
13,834,785 members
Click here to Skip to main content
Add your own
alternative version


45 bookmarked
Posted 29 Oct 2000
Licenced CPOL

XML Parser Demo

, 29 Oct 2000
Rate this:
Please Sign up or sign in to vote.
Using the Microsoft XML (MSXML) parser.
<!-- Download Links -->
  • Download source files - 13 Kb
  • <!-- Main HTML starts here -->


    In an attempt to learn how to exploit XML (eXtensible Mark-up Language) within my applications, I have found a very few demonstration applications to assist me in getting started. The documentation and examples in the Platform SDK for using the Microsoft XML Parser (built into Internet Explorer 4+, although I'm using IE5) all seem to be for Visual Basic/VBScript and not for C++/MFC.

    In this sample application I've simply tried to parse a XML file and visualise it as a basic tree view. The code recursively walks through both then ELEMENTS and ATTRIBUTES of the document. Some of the known element types are given an identifying icon and some of the contents/values are expressed too.

    Included within the .Zip file is my first XML file including a DTD (Document Type Definition).

    XML Parser
    Figure 1 - Sample XML Parser Dialog

    Parsing errors detected by the MSXML object are displayed within a message box and locate the problem location within the XML document.

    Parser Error
    Figure 2 - Parser Error Report

    See the source code for the parser code - it's quite simple.

    If you're interested, the long term aim of this file is to provide an externally configurable definition for toolbar and menu layouts within my applications. Due to the nature of the customer, end-user customisation is not applicable yet the specifications for what is wanted is likely to come through after I've left the project.


    This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


    About the Author

    Ray Hayes
    Product Manager
    United Kingdom United Kingdom
    No Biography provided

    You may also be interested in...

    Comments and Discussions

    Generalnot for C++/MFC Pin
    wachira anjana1-Aug-13 21:20
    memberwachira anjana1-Aug-13 21:20 
    QuestionIt's urgent Pin
    samymazine13-Dec-11 2:06
    membersamymazine13-Dec-11 2:06 
    AnswerRe: It's urgent Pin
    Ray Hayes13-Dec-11 2:54
    memberRay Hayes13-Dec-11 2:54 
    Questionit's urgent Pin
    samymazine12-Dec-11 15:23
    membersamymazine12-Dec-11 15:23 
    AnswerRe: it's urgent Pin
    chgra13-Dec-11 0:38
    memberchgra13-Dec-11 0:38 
    GeneralThank you Pin
    Crazy Joe Devola22-May-09 22:32
    memberCrazy Joe Devola22-May-09 22:32 
    GeneralHelp Pin
    swapnilwagh3-Aug-08 9:24
    memberswapnilwagh3-Aug-08 9:24 
    GeneralSQL Connection Pin
    Rajiv_cn15-Jul-08 6:37
    memberRajiv_cn15-Jul-08 6:37 
    GeneralRe: SQL Connection Pin
    Ray Hayes15-Jul-08 6:55
    memberRay Hayes15-Jul-08 6:55 
    QuestionHow do i add msxml6.dll to my installer ? Pin
    code4jigar5-Sep-06 3:19
    membercode4jigar5-Sep-06 3:19 
    GeneralXML Parser Demo: linker error Pin
    alex__b25-Sep-04 5:42
    memberalex__b25-Sep-04 5:42 
    GeneralRe: XML Parser Demo: linker error Pin
    amonlee29-Sep-04 23:33
    memberamonlee29-Sep-04 23:33 
    GeneralRe: XML Parser Demo: linker error Pin
    alex__b30-Sep-04 2:14
    memberalex__b30-Sep-04 2:14 
    GeneralRe: XML Parser Demo: linker error Pin
    LamerExterminator29-Aug-11 21:37
    memberLamerExterminator29-Aug-11 21:37 
    QuestionHow to validate related XML files against XML schema Pin
    Anonymous27-Jan-04 13:23
    memberAnonymous27-Jan-04 13:23 
    GeneralComplie Error --- help me ! Pin
    Muyen Chen20-Apr-02 8:42
    memberMuyen Chen20-Apr-02 8:42 
    GeneralRe: Complie Error --- help me ! Pin
    Ray Hayes21-Apr-02 23:39
    memberRay Hayes21-Apr-02 23:39 
    GeneralRe: Complie Error --- help me ! Pin
    8-May-02 0:43
    suss8-May-02 0:43 
    GeneralIt still can't work!------Give me your hand! Pin
    sterding7-Apr-02 2:45
    membersterding7-Apr-02 2:45 
    GeneralRe: It still can't work!------Give me your hand! Pin
    19-Apr-02 0:20
    suss19-Apr-02 0:20 
    GeneralRe: It still can't work!------Give me your hand! Pin
    chinahuangboc2019-Feb-04 17:11
    memberchinahuangboc2019-Feb-04 17:11 
    GeneralThanks a lot Pin
    Roberto Tortini12-Oct-01 7:18
    memberRoberto Tortini12-Oct-01 7:18 
    GeneralNice work Pin
    Amit Dey29-Apr-01 14:30
    memberAmit Dey29-Apr-01 14:30 
    GeneralRe: Nice work Pin
    Ray Hayes29-Apr-01 23:41
    memberRay Hayes29-Apr-01 23:41 
    GeneralRe: Nice work Pin
    Amit Dey15-Oct-03 6:45
    memberAmit Dey15-Oct-03 6:45 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
    Web03 | 2.8.190114.1 | Last Updated 30 Oct 2000
    Article Copyright 2000 by Ray Hayes
    Everything else Copyright © CodeProject, 1999-2019
    Layout: fixed | fluid