[TriLUG] XML and DOM

Ilan Volow listboy at clarux.com
Tue Mar 11 23:18:15 EST 2003


On Mon, 10 Mar 2003 10:08:50 -0500
Mike M <linux-support at earthlink.net> wrote:


> I have a large application that is written in C++.
> 
> My questions are above the implementation level - more at the design
> level.  I've got two possible XML uses and I'd like to get some
> feedback from you folks that have used it.
> 
> 1) Configuration.  I've got a draconian mess that needs to be hidden
> from the normal user.  I want to make a configurator that queries the
> user and outputs an XML file.  The XML configuration file is then
> accessed by the application during startup and operation.

IMHO, XML is what you always want for configuration files. The nice
thing about XML is that in addition to describing stuff, it also
provides a standardized way of parsing stuff. You don't have to write
seperate code for a parser, because the xml parser that someone else
wrote already does that for you. Also, if your config tools don't meet
someone's needs and they want to write a set that works better for them,
putting your config files in an XML format will make their life easier
as well. 

> 2) Interpretation.  I need to create an interpreter between a complex 
> protocol (where much of the complexity is unneeded) to a simple
> protocol.  The complex side is established and institutionalized.  The
> simple side is being designed from scratch and is TCP/IP
> sockets-based.  Both sides structure information formally.  I am
> thinking that the simple side message format should be implemented in
> XML. The application receives a simple side message and converts it to
> a complex side message, and vice-versa.
> 
> Is XML a good technology for what I describe above?  More detail
> available upon request.

I don't see why not. You might want to take a look at a lightweight XML
protocol like XML-RPC and see if that works before going to something
like SOAP. I've heard rumors that jabber is also well-suited for such
xml messaging applications. 

Another advantage of using XML, if you go with the web-based interface,
is that you can keep your structured data in XML format and then use
XSLT to simultaneously transform that data into a variety of different
presentation formats, such as html for desktops with browsers, wml for a
cellphone interface, an RSS feed for an RSS aggregator, or even a PDF
file for your secretary/pointy-haired boss. 

--Ilan






-- 
My choice after I quit film school was either to be a script writer for
porno flicks or a linux UI designer. And to tell you the truth, there's
hardly any difference. 





More information about the TriLUG mailing list