60件ヒット
[1-60件を表示]
(0.035秒)
種類
- インスタンスメソッド (36)
- 特異メソッド (12)
- クラス (12)
ライブラリ
-
rexml
/ document (60)
クラス
-
REXML
:: DocType (12) -
REXML
:: Document (24) -
REXML
:: Formatters :: Transitive (12)
検索結果
先頭5件
- REXML
:: Formatters :: Transitive - REXML
:: Formatters :: Transitive . new(indentation=2 , ie _ hack=false) -> REXML :: Formatter :: Transitive - REXML
:: Document # write(output = $ stdout , indent = -1 , transitive = false , ie _ hack = false , encoding=nil) -> () - REXML
:: Document # write(output: $ stdout , indent: -1 , transitive: false , ie _ hack: false , encoding: nil) -> () - REXML
:: DocType # write(output , indent = 0 , transitive = false , ie _ hack = false) -> ()
-
REXML
:: Formatters :: Transitive (18054.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
...l/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
# => "<root\n><children\n >\n<grandchild......>\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/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 (3201.0) -
フォーマッタオブジェクトを生成して返します。
フォーマッタオブジェクトを生成して返します。
このフォーマッタによる出力は基本的にテキストの空白や改行を変化させないと
いう制約のもと、出力を整形します。
indentation でインデント幅を指定できます。
ie_hack に真を渡すと、空のタグを閉じる前で空白を挿入します。
これは特定のバージョンのIEのXMLパーサのバグを避けるための機能です。
@param indentation インデント幅
@param ie_hack 空のタグを閉じる所にスペースを入れるかどうかを指定します -
REXML
:: Document # write(output = $ stdout , indent = -1 , transitive = false , ie _ hack = false , encoding=nil) -> () (208.0) -
output に XML 文書を出力します。
...ように << で書き込めるオブジェクト)
@param indent インデントのスペースの数(-1 だとインデントしない)
@param transitive XMLではインデントのスペースでDOMが変化してしまう場合がある。
これに真を渡すと、XMLのDOMに余計な... -
REXML
:: Document # write(output: $ stdout , indent: -1 , transitive: false , ie _ hack: false , encoding: nil) -> () (208.0) -
output に XML 文書を出力します。
...ように << で書き込めるオブジェクト)
@param indent インデントのスペースの数(-1 だとインデントしない)
@param transitive XMLではインデントのスペースでDOMが変化してしまう場合がある。
これに真を渡すと、XMLのDOMに余計な... -
REXML
:: DocType # write(output , indent = 0 , transitive = false , ie _ hack = false) -> () (207.0) -
output に DTD を出力します。
...m transitive 無視されます。指定しないでください。
@param ie_hack 無視されます。指定しないでください。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>......<!ATTLIST book
author CDATA #REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
<!ENTITY p "foobar publisher">
<!ENTITY % q "quzz">
]>
EOS
doctype.write(STDOUT)
# =>
# <!DOCTYPE books [
# <!ELEMENT book (comment)>
# ....
//}...