Posted by lnxexpert (lnxexpert), 24 April 2005Hello all,
Just looking for some good introductory TCL/Expect XML resources. I have already found these two at:
http://www.w3.org/XML/ ...basic geared for Windows
http://tclxml.sourceforge.net/ ...starts really deep
I have decent TCL/Expect skills but am having a hard time finding any introductory material showing me how to convert my programs to:
1) Write data taken from a user/stdin and write it to an XML file
2) Read data from an XML file and present it to a user in normal text
3) Query XML docs for specific elements
If any of you know of a TCL/Expect XML starting point I would greatly appreciate it.
Posted by admin (Graham Ellis), 25 April 2005I came across http://aspn.activestate.com/ASPN/Cookbook/Tcl?kwd=XML that seems like it might be a useful link.
As far as item (1) - writing XML - is concerned, it's probably easy enough to "roll you own". As long as you get the tagging right (and remember to protect characters such as < within data and " within attributes if they occur) it's no great shakes. Reading back is potentially more of an issue ....
Querying for specific elements - you're probably looking for what's known as a "SAX" parser or similar - see http://tclxml.sourceforge.net/tclxml.html for example - oh, but that's a link you have already. Basically, with a parser of thsi type you "simply" provide a proc that's to be called every time you hit the appropriate entry or exit tag.
"Presenting to the user as normal text" ... you need to decide on how it's to be formatted and you might decide to use XSLT to specity that. There's another potential link for this at http://www.linuxjournal.com/article/5622. Now XSLT is a complete language in its own right ....
Other Forum Posts
Follow us on ...
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho