るりまサーチ

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

別のキーワード

  1. _builtin $-l
  2. matrix l
  3. kernel $-l
  4. lupdecomposition l
  5. $-l kernel

ライブラリ

検索結果

REXML::Formatters::Default (24090.0)

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

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

REXML::Formatters::Pretty と
異なりテキストの改行や空白を修正せずにそのまま出力します。

//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::Document.new <...
...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
_formatter.write(REXML...
...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::Pretty (3030.0)

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

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

REXML::Formatters::Default
異なり見た目のためテキストの改行や空白を修正して出力します。

//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/pretty'
doc = REXML...
...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>"
# この...
...出力結果は入力のXMLよりも空白が増えている
//}...