22件ヒット
[1-22件を表示]
(0.017秒)
別のキーワード
ライブラリ
-
rexml
/ document (22)
クラス
-
REXML
:: Element (22)
検索結果
先頭2件
-
REXML
:: Element # text=(text) (18131.0) -
「先頭の」テキストノードを text で置き換えます。
...ment.new('<a><b/></a>')
doc.to_s # => "<a><b/></a>"
doc.root.text = "Foo"; doc.to_s # => "<a><b/>Foo</a>"
doc.root.text = "Bar"; doc.to_s # => "<a><b/>Bar</a>"
doc.root.add_element "c"
doc.root.text = "Baz"; doc.to_s # => "<a><b/>Baz<c/></a>"
doc.root.text = nil; doc.to_s # => "<a><b/><c/></a>"
//}... -
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (44.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...:Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
# >> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.eac......h_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}...