Index: xotcl/library/rdf/rdfRecreatorVisitor.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r435b41481fb51bf000ebe736d8574fefbeec1710 --- xotcl/library/rdf/rdfRecreatorVisitor.xotcl (.../rdfRecreatorVisitor.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/rdf/rdfRecreatorVisitor.xotcl (.../rdfRecreatorVisitor.xotcl) (revision 435b41481fb51bf000ebe736d8574fefbeec1710) @@ -1,35 +1,45 @@ -#$Id: rdfRecreatorVisitor.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +#$Id: rdfRecreatorVisitor.xotcl,v 1.2 2005/09/09 21:07:23 neumann Exp $ + package provide xotcl::rdf::recreatorVisitor 0.9 package require xotcl::rdf::parser package require xotcl::xml::recreatorVisitor +package require XOTcl -############################################################################## -# -# a visitor that recreates an RDF representation from a -# node tree -# -############################################################################# -Class RDFRecreatorVisitor -superclass XMLRecreatorVisitor +namespace eval ::xotcl::rdf::recreatorVisitor { + namespace import ::xotcl::* + + ############################################################################## + # + # a visitor that recreates an RDF representation from a + # node tree + # + ############################################################################# + Class RDFRecreatorVisitor -superclass XMLRecreatorVisitor -RDFRecreatorVisitor instproc appendLineFeed obj { - if {[set parseType [$obj getRDFAttribute parseType]] != ""} { - if {$parseType != "Resource"} { - # we have parseType == Literal - # -> don't append "\n" - return "" - } - } - return "\n" -} + RDFRecreatorVisitor instproc appendLineFeed obj { + if {[set parseType [$obj getRDFAttribute parseType]] != ""} { + if {$parseType != "Resource"} { + # we have parseType == Literal + # -> don't append "\n" + return "" + } + } + return "\n" + } -RDFRecreatorVisitor instproc visit objName { - next - my instvar result - if {[$objName istype RDFResource]} { - foreach t [$objName array names rdfTypes] { - set ts [$objName prependRDFPrefix type] - append result " [my insertIndent $objName]<$ts resource=\"$t\"/>\n" + RDFRecreatorVisitor instproc visit objName { + next + my instvar result + if {[$objName istype RDFResource]} { + foreach t [$objName array names rdfTypes] { + set ts [$objName prependRDFPrefix type] + append result " [my insertIndent $objName]<$ts resource=\"$t\"/>\n" + } + } + return $result } - } - return $result -} \ No newline at end of file + + namespace export RDFRecreatorVisitor +} + +namespace import ::xotcl::rdf::recreatorVisitor::*