るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.165秒)
トップページ > クエリ:>>[x] > クエリ:rexml/parsers/ultralightparser[x]

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document node_type
  4. rexml/document to_s
  5. rexml/document clone

検索結果

rexml/parsers/ultralightparser (38078.0)

パース結果を配列で作られた木構造により返すパーサ。

...re 'rexml/parsers/ultralightparser'
require 'pp'
parser = REXML::Parsers::UltraLightParser.new(<<XML)
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<a n="1">xyz</a>
<b m="2" />
</root>
XML
pp parser.parse
# >> [[:xmldecl, "1.0", "UTF-8", nil],
# >> [:text, "\n"],
# >> [:start_element,
# >>...
...[...],
# >> "root",
# >> {},
# >> [:text, "\n "],
# >> [:start_element, [...], "a", {"n"=>"1"}, [:text, "xyz"]],
# >> [:text, "\n "],
# >> [:start_element, [...], "b", {"m"=>"2"}],
# >> [:text, "\n"]],
# >> [:text, "\n"]]
//}...