11件ヒット
[1-11件を表示]
(0.093秒)
ライブラリ
-
rexml
/ document (11)
検索結果
-
REXML
:: Formatters :: Transitive (21031.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
...XMLドキュメントをテキストの内容を変えずに
多少の整形を加えて出力するクラスです。
これが有用な場合はあまりないでしょう。
整形されていない XML を整形したいが、
テキストの空白は改行は変えたくない場合には役......ょう。
//emlist[][ruby]{
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(d......children\n >\n<grandchildren foo='bar'\n />\n</children\n ></root\n>\n"
print output.string
# >> <root
# >> ><children
# >> >
# >> <grandchildren foo='bar'
# >> />
# >> </children
# >> ></root
# >> >
output = StringIO.new
transitive_formatter.write(REXML::XPath.first(doc, "/root/childr...