7件ヒット
[1-7件を表示]
(0.041秒)
ライブラリ
-
rexml
/ document (7)
キーワード
-
add
_ element (1) - attribute (1)
-
delete
_ attribute (1) -
each
_ element (1) -
each
_ element _ with _ attribute (1) -
get
_ text (1) - text (1)
検索結果
先頭5件
- REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil - REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil - REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () - REXML
:: Element # get _ text(path = nil) -> REXML :: Text | nil - REXML
:: Element # text(path = nil) -> String | nil
-
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (19246.0) -
name で指定される属性を返します。
name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という属性名を持つ属性を指定できます。
指定した属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = R... -
REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil (18925.0) -
要素から key という属性名の属性を削除します。
...。
@param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x='foo' y:x='bar'/>
e.delete_attribute("x")... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (18910.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
key で指定した属性名の属性を持つ要素のみを対象とします。
value を指定すると、keyで指定した属性名を持つ属性の値がvalueである
もののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。
max に 0 を指定すると、max の指定は無視されます(0個ではありません)。
@param key 属性名(文字列)
@param value 属性値(文字列)
... -
REXML
:: Element # get _ text(path = nil) -> REXML :: Text | nil (928.0) -
先頭のテキスト子ノードを返します。
...トノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#text
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> .... -
REXML
:: Element # text(path = nil) -> String | nil (928.0) -
先頭のテキスト子ノードの文字列を返します。
...トノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#get_text
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<... -
REXML
:: Element # add _ element(element , attrs = nil) -> Element (607.0) -
子要素を追加します。
...子要素を追加します。
element として追加する要素を指定します。
REXML::Element オブジェクトもしくは文字列を指定します。
element として REXML::Element オブジェクトを指定した場合、それが追加されます。
文字列を指定した場......'val1' attr2='val2'/>
doc.root.to_s # => "<a><my-tag/><my-tag attr1='val1' attr2='val2'/></a>"
el = REXML::Element.new 'my-tag'
doc.root.add_element el # => <my-tag/>
doc.root.to_s # => "<a><my-tag/><my-tag attr1='val1' attr2='val2'/><my-tag/></a>"
//}
@see REXML::Elements#add, REXML::Element.new... -
REXML
:: Element # each _ element(xpath = nil) {|element| . . . } -> () (607.0) -
各子要素を引数としてブロックを呼び出します。
各子要素を引数としてブロックを呼び出します。
xpath に文字列を指定するとそれにマッチする子要素のみを対象とします。
@param xpath XPath 文字列