55件ヒット
[1-55件を表示]
(0.030秒)
別のキーワード
ライブラリ
-
rexml
/ document (55)
キーワード
- [] (11)
- each (11)
-
each
_ attribute (11) -
get
_ attribute (11) -
get
_ attribute _ ns (11)
検索結果
先頭5件
-
REXML
:: Attributes # each {|name , value| . . . } -> () (214.0) -
各属性の名前と値に対しブロックを呼び出します。
...root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attributes.each do |name, value|
p [name, value]
end
# => ["foo:att", "1"]
# => ["bar:att", "2"]
# => ["att", "<"]
//}... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (214.0) -
各属性に対しブロックを呼び出します。
...ttp://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["",... -
REXML
:: Attributes # [](name) -> String | nil (202.0) -
属性名nameの属性値を返します。
...属性名nameの属性値を返します。
属性値ではなく REXML::Attribute オブジェクトが必要な場合は
REXML::Attributes#get_attribute を使ってください。
nameという属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
//emlis... -
REXML
:: Attributes # get _ attribute(name) -> Attribute | nil (202.0) -
name という名前の属性を取得します。
...名前を持つ属性がない場合は nil を返します。
@param name 属性名(文字列)
@see REXML::Attributes#[]
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='... -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (202.0) -
namespace と name で特定される属性を返します。
...aram namespace 名前空間(URI, 文字列)
@param name 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc...