Recursive XML Parser in C



Click here for larger image

Environment: Windows compiler for the GUI, ANSI C for the XML Parser.

The idea of this project was simply to write a basic XML parser in ANSI C for portability. The parser is reasonably forgiving as I have only a fairly rudimentary knowledge about XML and wanted to keep the code reasonably straight forward.

I then decided as an example application I'd write a simple GUI for demonstrative purposes, I decided against heavyweight MFC classes and wrote the GUI in C rather than C++ for reasons of consistency and the fact that the static nature of traditional windows programming does not lend it easily to object orientation. The GUI saves options to an XML file at termination (Options.xml) and allows you to drag and drop files onto the GUI for parsing. It consists of a rich edit window and a tree view.

When XML has been entered into the edit box and Parse selected from the menu the tree view will be updated. After the tree view has been updated you can select items in the tree view and it should also select the appropriate text in the edit window.

Note: Currently you need to reparse when you have updated the edit window before you can rely on the tree control being updated, I haven't yet had a chance to automatically update the tree control when updates occur.

There are one are two bugs which need ironing out (nobodys perfect!), if enough people spot them I'll have a look at them.

Downloads

Download demo project - 22.2 Kb
Download source - 29.2 Kb


Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: September 17, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Another day, another end-of-support deadline. You've heard enough about the hazards of not migrating to Windows Server 2008 or 2012. What you may not know is that there's plenty in it for you and your business, like increased automation and performance, time-saving technical features, and a lower total cost of ownership. Check out this upcoming eSeminar and join Rich Holmes, Pomeroy's practice director of virtualization, as he discusses the …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds