Search Tools Links Login

XML Engine (classes and demo)

The XML Engine is a set of classes designed to make it easy for your programs to parse and construct XML.

The parser can be used either to automatically construct an easy-to-use data structure (like I.E.'s document object model) or direct your program (through events) to do what it needs to on the fly. This latter mode facilitates work on the data even as the XML is being incrementally received, as from a long file download. This means your program won't have to wait to start work and can avoid memory overruns associated with "passively" parsing huge XML files. This approach could even be used with an endless stream of XML, which would be great for quickly implementing a simple client/server communication protocol (search for my "Socket Controls" package here at PSC).

The XmlElement class, which represents a node in an XML tree, can be used independently of the engine. Your program can easily clone an XML tree, insert new branches anywhere, remove whole branches, and export it to raw XML or plain text (stripped of XML tags). The plain-text export can be given an array telling it what to replace certain tags with, too. An element node can be either a representation of a named tag (e.g., "TABLE") with named attributes or a text block (anything that would appear in-between tags).

A demo program is included with simple demonstrations of a number of basic techniques.

This engine does not deal with every last idiosyncracy of XML and assumes any XML it parses is well-formed. DTD's are not supported (not that they really relevant, here). But the basics of XML are supported. It can even be used as an HTML generator and parser, provided the HTML is XML-formatted (all start tags must have end tags or be single-tag formatted like "<SOMETAG/>").

Unfortunately, there is currently no documentation, but the code is straightforward and easy to read. Further, the demos should provide enough explanation for how to use the engine.

Your comments and votes are welcome.

Original Author: James Vincent Carnicelli

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 93 times


Visual Basic 6

Posted: 9/3/2020 3:45:00 PM
Size: 8,072 bytes

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.