File: treetest.rb

package info (click to toggle)
libxml-parser-ruby 0.6.8-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 908 kB
  • ctags: 1,524
  • sloc: ruby: 11,080; ansic: 1,958; xml: 467; makefile: 69
file content (14 lines) | stat: -rwxr-xr-x 516 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /usr/local/bin/ruby -Ke

require "xml/dom/core"
include XML::DOM

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