#!../../src/xotclsh
#
# small Example for usage of xoXML
package require xotcl::package
package require xotcl::trace
package require xotcl::xml::parser
package require xotcl::xml::recreatorVisitor
package require xotcl::xml::printVisitor
#
# instantiate parser and parser an example text into a node tree
#
XMLParser x
#x parse {
#
x parse {
a
b
c
b
c
a
b
c
b
d
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
pv interpretAll x
#
# recreate xml text and print it to the std output
#
puts \n
puts ************************************************************************
puts "Recreated XML Text:"
puts ************************************************************************
XMLRecreatorVisitor rv
puts [rv interpretAll x]
}
run
XMLParser y
y parse {
olla
hallo
}
XMLRecreatorVisitor rv
puts [rv interpretAll y]