VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



XML Engine (classes and demo)

by James Vincent Carnicelli (21 Submissions)
Category: Data Structures
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (9 Votes)

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 VBC).

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.

Rate XML Engine (classes and demo)

Download XML Engine (classes and demo)

Download XML Engine (classes and demo) (7 KB)

XML Engine (classes and demo) Comments

No comments have been posted about XML Engine (classes and demo). Why not be the first to post a comment about XML Engine (classes and demo).

Post your comment

Subject:
Message:
0/1000 characters