5,673,111 members and growing! (21,407 online)
Email Password   helpLost your password?
Languages » C / C++ Language » General     Intermediate License: The Code Project Open License (CPOL)

XML Parser Demo

By Ray Hayes

Using the Microsoft XML (MSXML) parser.
XML, VC6, C++, HTMLWindows, NT4, Win2K, MFC, IE 6.0, VS6, Visual Studio, IE, Dev

Posted: 29 Oct 2000
Updated: 29 Oct 2000
Views: 202,754
Bookmarked: 27 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
32 votes for this Article.
Popularity: 5.60 Rating: 3.72 out of 5
3 votes, 23.1%
1
0 votes, 0.0%
2
1 vote, 7.7%
3
1 vote, 7.7%
4
8 votes, 61.5%
5
  • 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



    Occupation: Product Manager
    Location: United Kingdom United Kingdom

    Other popular C / C++ Language articles:

    Article Top
    Sign Up to vote for this article
    You must Sign In to use this message board.
    FAQ FAQ Noise ToleranceSearch Search Messages 
     Layout  Per page   
     Msgs 1 to 25 of 43 (Total in Forum: 43) (Refresh)FirstPrevNext
    GeneralHelpmemberswapnilwagh9:24 3 Aug '08  
    GeneralSQL ConnectionmemberRajiv_cn6:37 15 Jul '08  
    GeneralRe: SQL ConnectionmemberRay Hayes6:55 15 Jul '08  
    QuestionHow do i add msxml6.dll to my installer ?membercode4jigar3:19 5 Sep '06  
    GeneralXML Parser Demo: linker errormemberalex__b5:42 25 Sep '04  
    GeneralRe: XML Parser Demo: linker errormemberamonlee23:33 29 Sep '04  
    GeneralRe: XML Parser Demo: linker errormemberalex__b2:14 30 Sep '04  
    GeneralHow to validate related XML files against XML schemasussanonymous13:23 27 Jan '04  
    GeneralComplie Error --- help me !memberMuyen Chen8:42 20 Apr '02  
    GeneralRe: Complie Error --- help me !memberRay Hayes23:39 21 Apr '02  
    GeneralRe: Complie Error --- help me !memberTurkey0:43 8 May '02  
    GeneralIt still can't work!------Give me your hand!membersterding2:45 7 Apr '02  
    GeneralRe: It still can't work!------Give me your hand!memberAnonymous0:20 19 Apr '02  
    GeneralRe: It still can't work!------Give me your hand!memberchinahuangboc2017:11 19 Feb '04  
    GeneralThanks a lotmembertortini7:18 12 Oct '01  
    GeneralNice workmemberAmit Dey14:30 29 Apr '01  
    GeneralRe: Nice workmemberRay Hayes23:41 29 Apr '01  
    GeneralRe: Nice workmemberAmit Dey6:45 15 Oct '03  
    GeneralRe: Nice workmemberTodd.Harvey10:39 17 Apr '02  
    GeneralCompile errormemberPaolo Bortolazzi6:56 23 Apr '01  
    GeneralRe: Compile errormemberRay Hayes8:19 23 Apr '01  
    Generallooking for the XML tutorial FOR Beginnersmembermil23:40 6 Nov '00  
    GeneralRe: looking for the XML tutorial FOR BeginnersmemberFelix Rivera12:49 9 Nov '00  
    GeneralRe: looking for the XML tutorial FOR Beginnersmembermil18:11 9 Nov '00  
    GeneralMSXML 3.0 FinalmemberBrad Bruce5:06 4 Nov '00  

    General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    PermaLink | Privacy | Terms of Use
    Last Updated: 29 Oct 2000
    Editor: Chris Maunder
    Copyright 2000 by Ray Hayes
    Everything else Copyright © CodeProject, 1999-2008
    Web07 | Advertise on the Code Project