108件ヒット
[101-108件を表示]
(0.013秒)
別のキーワード
種類
- インスタンスメソッド (48)
- 特異メソッド (36)
- クラス (24)
ライブラリ
- prettyprint (24)
-
rexml
/ document (84)
クラス
- PrettyPrint (24)
-
REXML
:: Formatters :: Pretty (60)
検索結果
-
REXML
:: Formatters :: Default (3006.0) -
XMLドキュメントを(文字列として)出力するクラスです。
...:Formatters::Pretty と
異なりテキストの改行や空白を修正せずにそのまま出力します。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::Document.new <<EOS
<root>
<children>
<grandchildren/>
</children>
</root>
EOS
default_formatt......er = 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::XPath.first(doc, "/root/children"), output)
output.string
# => "<ch......ildren>\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"
//}...