File: treetest.rb

package info (click to toggle)
libxml-parser-ruby 0.6.1-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 676 kB
  • ctags: 800
  • sloc: ruby: 5,723; ansic: 1,734; xml: 574; makefile: 152
file content (14 lines) | stat: -rwxr-xr-x 518 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /usr/local/bin/ruby -Ke

require "xmltree"
include XML::SimpleTree

tree = Document.new(ProcessingInstruction.new("xml",
                                         "version='1.0' encoding='EUC-JP'"),
                    Comment.new(""),
                    Element.new("Test", [
                                  Attr.new('attr1', "°1"),
                                  Attr.new('attr2', "°2")],
                                Element.new("para", nil, "ˤ")))
print tree.to_s, "\n"
tree.dump