Click here to Skip to main content
11,707,254 members (64,114 online)
Click here to Skip to main content

XML Parser Demo

, 29 Oct 2000 CPOL 281.8K 4K 43
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 -->

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

    License

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

    Share

    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 20:20
    memberwachira anjana1-Aug-13 20:20 
    QuestionIt's urgent Pin
    samymazine13-Dec-11 1:06
    membersamymazine13-Dec-11 1:06 
    AnswerRe: It's urgent Pin
    Ray Hayes13-Dec-11 1:54
    memberRay Hayes13-Dec-11 1:54 
    Questionit's urgent Pin
    samymazine12-Dec-11 14:23
    membersamymazine12-Dec-11 14:23 
    AnswerRe: it's urgent Pin
    chgra12-Dec-11 23:38
    memberchgra12-Dec-11 23:38 
    GeneralThank you Pin
    yaron klodovski22-May-09 21:32
    memberyaron klodovski22-May-09 21:32 
    GeneralSQL Connection Pin
    Rajiv_cn15-Jul-08 5:37
    memberRajiv_cn15-Jul-08 5:37 
    GeneralRe: SQL Connection Pin
    Ray Hayes15-Jul-08 5:55
    memberRay Hayes15-Jul-08 5:55 
    QuestionHow do i add msxml6.dll to my installer ? Pin
    code4jigar5-Sep-06 2:19
    membercode4jigar5-Sep-06 2:19 
    GeneralXML Parser Demo: linker error Pin
    alex__b25-Sep-04 4:42
    memberalex__b25-Sep-04 4:42 
    GeneralRe: XML Parser Demo: linker error Pin
    amonlee29-Sep-04 22:33
    memberamonlee29-Sep-04 22:33 
    GeneralRe: XML Parser Demo: linker error Pin
    alex__b30-Sep-04 1:14
    memberalex__b30-Sep-04 1:14 
    GeneralRe: XML Parser Demo: linker error Pin
    LamerExterminator29-Aug-11 20:37
    memberLamerExterminator29-Aug-11 20:37 
    QuestionHow to validate related XML files against XML schema Pin
    anonymous27-Jan-04 12:23
    sussanonymous27-Jan-04 12:23 
    GeneralComplie Error --- help me ! Pin
    Muyen Chen20-Apr-02 7:42
    memberMuyen Chen20-Apr-02 7:42 
    GeneralRe: Complie Error --- help me ! Pin
    Ray Hayes21-Apr-02 22:39
    memberRay Hayes21-Apr-02 22:39 
    GeneralRe: Complie Error --- help me ! Pin
    Turkey7-May-02 23:43
    memberTurkey7-May-02 23:43 
    GeneralIt still can't work!------Give me your hand! Pin
    sterding7-Apr-02 1:45
    membersterding7-Apr-02 1:45 
    GeneralRe: It still can't work!------Give me your hand! Pin
    Anonymous18-Apr-02 23:20
    memberAnonymous18-Apr-02 23:20 
    GeneralRe: It still can't work!------Give me your hand! Pin
    chinahuangboc2019-Feb-04 16:11
    memberchinahuangboc2019-Feb-04 16:11 
    GeneralThanks a lot Pin
    tortini12-Oct-01 6:18
    membertortini12-Oct-01 6:18 
    GeneralNice work Pin
    Amit Dey29-Apr-01 13:30
    memberAmit Dey29-Apr-01 13:30 
    GeneralRe: Nice work Pin
    Ray Hayes29-Apr-01 22:41
    memberRay Hayes29-Apr-01 22:41 
    GeneralRe: Nice work Pin
    Amit Dey15-Oct-03 5:45
    memberAmit Dey15-Oct-03 5:45 
    GeneralRe: Nice work Pin
    Todd.Harvey17-Apr-02 9:39
    memberTodd.Harvey17-Apr-02 9:39 
    GeneralCompile error Pin
    Paolo Bortolazzi23-Apr-01 5:56
    memberPaolo Bortolazzi23-Apr-01 5:56 
    GeneralRe: Compile error Pin
    Ray Hayes23-Apr-01 7:19
    memberRay Hayes23-Apr-01 7:19 
    Generallooking for the XML tutorial FOR Beginners Pin
    mil6-Nov-00 22:40
    membermil6-Nov-00 22:40 
    GeneralRe: looking for the XML tutorial FOR Beginners Pin
    Felix Rivera9-Nov-00 11:49
    memberFelix Rivera9-Nov-00 11:49 
    GeneralRe: looking for the XML tutorial FOR Beginners Pin
    mil9-Nov-00 17:11
    membermil9-Nov-00 17:11 
    GeneralMSXML 3.0 Final Pin
    Brad Bruce4-Nov-00 4:06
    memberBrad Bruce4-Nov-00 4:06 
    GeneralWorth the effort Pin
    Adrian31-Oct-00 19:17
    sussAdrian31-Oct-00 19:17 
    GeneralUse XML4C from Apache/IBM Pin
    Jamie Nordmeyer31-Oct-00 6:27
    sussJamie Nordmeyer31-Oct-00 6:27 
    GeneralRe: Use XML4C from Apache/IBM Pin
    Josh Nussbaum1-Nov-00 12:02
    sussJosh Nussbaum1-Nov-00 12:02 
    GeneralRe: Use XML4C from Apache/IBM Pin
    Jamie Nordmeyer1-Nov-00 12:43
    sussJamie Nordmeyer1-Nov-00 12:43 
    GeneralRe: Use XML4C from Apache/IBM Pin
    Leo Davidson3-Nov-00 1:13
    sussLeo Davidson3-Nov-00 1:13 
    GeneralRe: Use XML4C from Apache/IBM Pin
    Anonymous20-Aug-01 7:53
    memberAnonymous20-Aug-01 7:53 
    GeneralXML Version 3 beta (September) Pin
    Ray Hayes31-Oct-00 1:36
    sussRay Hayes31-Oct-00 1:36 
    GeneralIt is not Working Properly Pin
    VenkataKrishnan.K31-Oct-00 0:30
    sussVenkataKrishnan.K31-Oct-00 0:30 
    GeneralRe: It is not Working Properly Pin
    Ray Hayes31-Oct-00 0:49
    sussRay Hayes31-Oct-00 0:49 
    GeneralRe: It is not Working Properly Pin
    Brad Bruce31-Oct-00 1:42
    sussBrad Bruce31-Oct-00 1:42 
    GeneralCompile Error Pin
    niv30-Oct-00 23:23
    sussniv30-Oct-00 23:23 
    GeneralRe: Compile Error Pin
    Ray Hayes30-Oct-00 23:46
    sussRay Hayes30-Oct-00 23:46 
    GeneralRe: Compile Error: Include the Following Lines Pin
    VenkataKrishnan.K31-Oct-00 0:48
    sussVenkataKrishnan.K31-Oct-00 0:48 
    GeneralRe: Compile Error: Include the Following Lines Pin
    eric Richards31-Oct-00 9:50
    susseric Richards31-Oct-00 9:50 
    GeneralRe: Compile Error: Include the Following Lines Pin
    Adrian31-Oct-00 19:18
    sussAdrian31-Oct-00 19:18 
    GeneralRe: Compile Error: Include the Following Lines Pin
    Praveen KR9-May-01 18:03
    memberPraveen KR9-May-01 18:03 
    GeneralRe: Compile Error: Include the Following Lines Pin
    Anonymous11-May-01 0:38
    memberAnonymous11-May-01 0:38 
    GeneralRe: Compile Error: Include the Following Lines Pin
    sterding7-Apr-02 2:07
    membersterding7-Apr-02 2:07 

    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 | Terms of Use | Mobile
    Web03 | 2.8.150819.1 | Last Updated 30 Oct 2000
    Article Copyright 2000 by Ray Hayes
    Everything else Copyright © CodeProject, 1999-2015
    Layout: fixed | fluid