| Class | Uttk::Dumpers::Xml |
| In: |
lib/uttk/dumpers/Xml.rb
|
| Parent: | Dumper |
# File lib/uttk/dumpers/Xml.rb, line 17 def initialize ( *a, &b ) super puts '<?xml version="1.0" encoding="iso-8859-1"?>' reset end
# File lib/uttk/dumpers/Xml.rb, line 24 def reset @doc = @root = REXML::Document.new @doc_stack = [] end
# File lib/uttk/dumpers/Xml.rb, line 77 def clean_for_xml ( anObject ) str = anObject.to_s str.gsub!(/[^a-zA-Z:-_]/, '_') str end
# File lib/uttk/dumpers/Xml.rb, line 54 def new_leaf ( path, leaf ) super @doc.add_text(leaf.to_s) end
# File lib/uttk/dumpers/Xml.rb, line 41 def new_node ( path, node ) super doc_ = @doc opts = { :name => node.segment } if type = node.options[:type] opts[:type] = type end add_elt(:node, opts) @doc_stack << doc_ end