Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML vs. Delimited Text document

Status
Not open for further replies.

Malachi

Programmer
Aug 13, 2001
38
0
0
US
I'm interested in converting some programs I've written for personal use to utilize XML as a "configuration file" format. Currently, I'm using delimited text documents to define input records for a project management tool written in Tcl/Tk. The program opens the configuration file, reads all of the data into internal arrays and lists, then uses the definitions gleaned from the input file. When a change occurs, the change is stored in memory and eventually written to disk when the user asks to save the configuration.

I've wanted to expand the program, but end up spending a lot of time rewriting the parser logic in order to add additional values to the "configuration file".

So, this brings me to XML. I've begun using the Tcl xml package, but don't quite understand the philosophy of the SAX-like parser. It seems to me, at this early stage, that XML isn't much more sophisticated than a delimited text document. Using a SAX parser I'm still required to read the entire document into memory, use the data, and then re-write the document to disk when a change is made.

Am I correct in my assumption, or is there something more useful XML can provide that a text file can't?
 
>> is there something more useful XML can provide that
>> a text file can't?

Well someone already answered that question...

>> I've wanted to expand the program, but end up spending
>> a lot of time rewriting the parser logic

Oh, right it was YOU. Now what is ur real question?

Of course there is much more that XML/XSLT/XPATH can do but it's ok with me if you keep using proprietary data formats. It's a free digital universe after all. Just don't ask me to work with any of it.

"But, that's just my opinion... I could be wrong."
-pete
 
Thank you for responding. I know XML can provide a means to eliminate proprietary data formats, but I'm far from understanding how to use XML as a data format for my programs. I think what I should have asked is "Are there any good introductory books about XML usage?". I'm sure that has been answered already.

I've reviewed the tutorials, and have read some papers at XML.org. These sites are great about explaining XML and it's format, but seem to lack information about writing programs to use the XML formatted data. I'm capable of writing a DTD and an XML document by hand. I could even write a parser to use the XML document, but that's what I'm trying to avoid. Additionally, the XML formatted document would be about 3 times larger than an ASCII text document, which I'm using already.

I'm really really interested in discovering and using best practices for parsing and using XML as a data format. There must be a reason XML is so popular.

I'll keep looking.
 
Look into DOM... and maybe let people know what language you're using.

I'd try to be more helpful, but I just really started myself (had used stylesheets with XML before, but this is a whole new ball game).

With VB 6.0 it's apparently all about DOM and msxml3.dll

Hope that helps.

-Rob
 
I'm using ActiveStates Tcl/Tk v8.4. The parser I'm using is Zveno ( TclXML, a SAX like parser. The utility I'm writing is a personal document management program for use on Windows and Linux. It already works well with my proprietary configuration file. I want to use XML for two reasons; as an exercise, and to easily expand the program without re-writing the parsing routines for each new element.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top