Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
TCL/Expect XML

Posted by lnxexpert (lnxexpert), 24 April 2005
Hello 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 2005
I 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 ....



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho