Version 6 of TreeCL

Updated 2004-08-13 18:41:49

20040712 CMcC: I've written a cost-like tree editing language. More details will follow, but I just had to grab this great pun name.

I've put up some docs and a working version of TreeCL here: http://sharedtech.dyndns.org/~colin/treecl/docs/ - CMcC 20040813


Some Examples from the included doc.tcl

Create a doc given a URL:

    doc homepage -url http://sharedtech.dyndns.org/

Create a Costq query over the doc tree:

    Costq nh -tree homepage

Print only the PCDATA content of the page:

    puts "TEXT: [nh query tree content]"

Print the href attributes of all <a> tags:

    puts "A: [nh query tree withtag a attval href]"

Another way to do the same:

    puts "A2: [nh query tree hasatt href attval href]"

Print the size of the tree:

    puts "SIZE: [homepage size]"

Brian Theado - 20040813 - Any chance you could package this up with all its dependencies in a starkit? I'd like to be able to do "source treecl.kit; package require costq". I tried to download and run it to try and understand better what it does and what it can be used for and stumbled because I don't have a recent enough tcllib (it appears to require struct packages that haven't been released and can only be found in CVS). I can get all the dependencies myself and right now I'm not going to take the time.

Also, what is needed before executing the above code? Package require treecl? Package require costq?

For those interested in using this with tcllib's struct::tree, it appears that a small wrapper to convert the "rootname" method to "root" and add a "descendents" method, should do the trick. Am I right?