るりまサーチ

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

別のキーワード

  1. fileutils rm
  2. fileutils rm_r
  3. fileutils rm_f
  4. fileutils rm_rf
  5. un rm

種類

ライブラリ

検索結果

REXML::Formatters::Transitive (21030.0)

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

...require '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
# =...
...ing
# >> <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>...

REXML::Formatters::Transitive.new(indentation=2, ie_hack=false) -> REXML::Formatter::Transitive (6201.0)

フォーマッタオブジェクトを生成して返します。

フォーマッタオブジェクトを生成して返します。

このフォーマッタによる出力は基本的にテキストの空白や改行を変化させないと
いう制約のもと、出力を整形します。

indentation でインデント幅を指定できます。

ie_hack に真を渡すと、空のタグを閉じる前で空白を挿入します。
これは特定のバージョンのIEのXMLパーサのバグを避けるための機能です。

@param indentation インデント幅
@param ie_hack 空のタグを閉じる所にスペースを入れるかどうかを指定します