るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.161秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:rexml[x] > クラス:REXML::CData[x] > クエリ:to_s[x]

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document to_s
  4. rexml/document clone
  5. rexml/document node_type

ライブラリ

キーワード

検索結果

REXML::CData#to_s -> String (24338.0)

テキスト文字列を返します。

...テキスト文字列を返します。

@see REXML::Text#value, REXML::Text#to_s

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}...

REXML::CData#value -> String (9238.0)

テキスト文字列を返します。

...テキスト文字列を返します。

@see REXML::Text#value, REXML::Text#to_s

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}...

REXML::CData.new(text, respect_whitespace = true, parent = nil) -> REXML::CData (6550.0)

text をテキストとして持つ CData オブジェクトを生成します。

...ます。

r
espect_whitespace に真を指定すると、text に含まれる空白文字は保存されます。
偽の場合は空白はまとめられます。

@param text テキスト文字列
@param respect_whitespace 空白を保存するかどうかを決める真偽値
@param parent 親ノ...
...ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root />
EOS
doc.root.add(REXML::CData.new("foo bar baz "))
doc.to_s # => "<root><![CDATA[foo bar baz ]]></root>\n"

doc = REXML::Document.new(<<EOS)
<root />
EOS
doc.root.add(REXML::CData.new("foo bar baz ", true))
doc.root.add(R...
...EXML::CData.new("foo bar baz ", false))
doc.to_s # => "<root><![CDATA[foo bar baz ]]><![CDATA[foo bar baz ]]></root>\n"
//}...