#!../../src/xotclsh #!/usr/local/bin/xotclsh # $Id: rdfExample.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ # # small Example for usage of xoXML # package require xotcl::package package require xotcl::trace package require xotcl::rdf::parser package require xotcl::rdf::recreatorVisitor package require xotcl::xml::printVisitor # # instantiate parser and parser an example text into a node tree # RDFParser x x parse { Mary Andrew Jacky Crystal The Coolest Web Page Il Pagio di Web Fuba some text } proc run {} { # # print the node treee to the std output # puts ************************************************************************ puts "Node Tree:" puts ************************************************************************ PrintVisitor pv foreach tn [x info children topNode*] { pv interpretNodeTree $tn } # # recreate xml text and print it to the std output # puts \n puts ************************************************************************ puts "Recreated RDF Text:" puts ************************************************************************ RDFRecreatorVisitor rv foreach tn [x info children topNode*] { set result [rv interpretNodeTree $tn] puts $result } } run