Click here to Skip to main content
Click here to Skip to main content
Go to top

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. </body>


    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

    Comments and Discussions

    Generalnot for C++/MFC Pinmemberwachira anjana1-Aug-13 20:20 
    QuestionIt's urgent Pinmembersamymazine13-Dec-11 1:06 
    AnswerRe: It's urgent PinmemberRay Hayes13-Dec-11 1:54 
    Questionit's urgent Pinmembersamymazine12-Dec-11 14:23 
    AnswerRe: it's urgent Pinmemberchgra12-Dec-11 23:38 
    GeneralThank you Pinmemberyaron klodovski22-May-09 21:32 
    GeneralHelp Pinmemberswapnilwagh3-Aug-08 8:24 
    GeneralSQL Connection PinmemberRajiv_cn15-Jul-08 5:37 
    GeneralRe: SQL Connection PinmemberRay Hayes15-Jul-08 5:55 
    QuestionHow do i add msxml6.dll to my installer ? Pinmembercode4jigar5-Sep-06 2:19 
    GeneralXML Parser Demo: linker error Pinmemberalex__b25-Sep-04 4:42 
    GeneralRe: XML Parser Demo: linker error Pinmemberamonlee29-Sep-04 22:33 
    GeneralRe: XML Parser Demo: linker error Pinmemberalex__b30-Sep-04 1:14 
    GeneralRe: XML Parser Demo: linker error PinmemberLamerExterminator29-Aug-11 20:37 
    QuestionHow to validate related XML files against XML schema Pinsussanonymous27-Jan-04 12:23 
    GeneralComplie Error --- help me ! PinmemberMuyen Chen20-Apr-02 7:42 
    GeneralRe: Complie Error --- help me ! PinmemberRay Hayes21-Apr-02 22:39 
    GeneralRe: Complie Error --- help me ! PinmemberTurkey7-May-02 23:43 
    GeneralIt still can't work!------Give me your hand! Pinmembersterding7-Apr-02 1:45 
    GeneralRe: It still can't work!------Give me your hand! PinmemberAnonymous18-Apr-02 23:20 
    GeneralRe: It still can't work!------Give me your hand! Pinmemberchinahuangboc2019-Feb-04 16:11 
    GeneralThanks a lot Pinmembertortini12-Oct-01 6:18 
    GeneralNice work PinmemberAmit Dey29-Apr-01 13:30 
    GeneralRe: Nice work PinmemberRay Hayes29-Apr-01 22:41 
    GeneralRe: Nice work PinmemberAmit Dey15-Oct-03 5:45 

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

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

    | Advertise | Privacy | Mobile
    Web02 | 2.8.140922.1 | Last Updated 30 Oct 2000
    Article Copyright 2000 by Ray Hayes
    Everything else Copyright © CodeProject, 1999-2014
    Terms of Service
    Layout: fixed | fluid