るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.042秒)
トップページ > クエリ:String[x] > クエリ:children[x] > 種類:クラス[x]

別のキーワード

  1. string []=
  2. string slice!
  3. string slice
  4. string []
  5. string gsub!

ライブラリ

キーワード

検索結果

REXML::Formatters::Default (73.0)

XMLドキュメントを(文字列として)出力するクラスです。

...new <<EOS
<root>
<children>
<grandchildren/>
</children>
</root>
EOS

default_formatter = REXML::Formatters::Default.new
output = StringIO.new
default_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren/>\n</children>\n</root>\n"

output = StringIO.new
default_for...
...t(doc, "/root/children"), output)
output.string
# => "<children>\n <grandchildren/>\n</children>"

ie_hack_formatter = REXML::Formatters::Default.new(true)
output = StringIO.new
ie_hack_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren />\n</children>\n</root>\n"...

REXML::Formatters::Transitive (73.0)

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

...ew <<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\n><children\n >\n<grandchildren foo='bar'\n />\n</children\n ></root\n>\...
...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...

REXML::Formatters::Pretty (31.0)

XMLドキュメントを(文字列として)見た目良く出力するクラスです。

...ent.new <<EOS
<root>
<children>
<grandchildren foo='bar'/>
</children>
</root>
EOS

pretty_formatter = REXML::Formatters::Pretty.new
output = StringIO.new
pretty_formatter.write(doc, output)
output.string
# => "<root>\n <children>\n <grandchildren foo='bar'/>\n </children>\n</root>"
# この...