Click here to Skip to main content
Licence CPOL
First Posted 29 Oct 2000
Views 254,184
Bookmarked 37 times

XML Parser Demo

By | 29 Oct 2000 | Article
Using the Microsoft XML (MSXML) parser.
  • Download source files - 13 Kb
  • Introduction

    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.

    License

    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

    Member



    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    QuestionIt's urgent Pinmembersamymazine1:06 13 Dec '11  
    AnswerRe: It's urgent PinmemberRay Hayes1:54 13 Dec '11  
    Questionit's urgent Pinmembersamymazine14:23 12 Dec '11  
    AnswerRe: it's urgent Pinmemberchgra23:38 12 Dec '11  
    GeneralThank you Pinmemberyaron klodovski21:32 22 May '09  
    GeneralHelp Pinmemberswapnilwagh8:24 3 Aug '08  
    GeneralSQL Connection PinmemberRajiv_cn5:37 15 Jul '08  
    GeneralRe: SQL Connection PinmemberRay Hayes5:55 15 Jul '08  
    QuestionHow do i add msxml6.dll to my installer ? Pinmembercode4jigar2:19 5 Sep '06  
    GeneralXML Parser Demo: linker error Pinmemberalex__b4:42 25 Sep '04  
    GeneralRe: XML Parser Demo: linker error Pinmemberamonlee22:33 29 Sep '04  
    GeneralRe: XML Parser Demo: linker error Pinmemberalex__b1:14 30 Sep '04  
    GeneralRe: XML Parser Demo: linker error PinmemberLamerExterminator20:37 29 Aug '11  
    QuestionHow to validate related XML files against XML schema Pinsussanonymous12:23 27 Jan '04  
    GeneralComplie Error --- help me ! PinmemberMuyen Chen7:42 20 Apr '02  
    GeneralRe: Complie Error --- help me ! PinmemberRay Hayes22:39 21 Apr '02  
    GeneralRe: Complie Error --- help me ! PinmemberTurkey23:43 7 May '02  
    GeneralIt still can't work!------Give me your hand! Pinmembersterding1:45 7 Apr '02  
    GeneralRe: It still can't work!------Give me your hand! PinmemberAnonymous23:20 18 Apr '02  

    add the following line
     
    using namespace MSXML;
     
    below the line
     
    #include
     
    Then it works.
     

     
    Ligang
    GeneralRe: It still can't work!------Give me your hand! Pinmemberchinahuangboc2016:11 19 Feb '04  
    GeneralThanks a lot Pinmembertortini6:18 12 Oct '01  
    GeneralNice work PinmemberAmit Dey13:30 29 Apr '01  
    GeneralRe: Nice work PinmemberRay Hayes22:41 29 Apr '01  
    GeneralRe: Nice work PinmemberAmit Dey5:45 15 Oct '03  
    GeneralRe: Nice work PinmemberTodd.Harvey9:39 17 Apr '02  

    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.

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