るりまサーチ

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

別のキーワード

  1. _builtin first
  2. array first
  3. range first
  4. matrix first_minor
  5. enumerable first

ライブラリ

検索結果

REXML::Formatters::Transitive (18036.0)

XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。

...quire 'rexml/document'
require 'rexml/formatters/transitive'
doc = REXML::Document.new <<EOS
<root><children>
<grandchildren foo='bar' />
</children></root>
EOS

transitive
_formatter = REXML::Formatters::Transitive.new
output = StringIO.new
transitive
_formatter.write(doc, output)
output.string
# =>...
...>> <root
# >> ><children
# >> >
# >> <grandchildren foo='bar'
# >> />
# >> </children
# >> ></root
# >> >

output = StringIO.new
transitive
_formatter.write(REXML::XPath.first(doc, "/root/children"), output)
output.string
# => "<children\n>\n<grandchildren foo='bar'\n />\n</children\n>"
//}...