132件ヒット
[1-100件を表示]
(0.021秒)
ライブラリ
-
rexml
/ document (132)
キーワード
- [] (11)
- []= (11)
- delete (11)
-
delete
_ all (11) - each (11)
-
each
_ attribute (11) -
get
_ attribute (11) -
get
_ attribute _ ns (11) - length (11)
- namespaces (11)
- prefixes (11)
- size (11)
検索結果
先頭5件
-
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (31.0) -
namespace と name で特定される属性を返します。
...<<-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.get_elements("/root/a").first
a.attributes.get_attribute_ns("", "att") # => att='<'
a.attributes.get_attribute_ns("http://example.org/foo", "at......t") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (25.0) -
各属性に対しブロックを呼び出します。
...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_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http... -
REXML
:: Attributes # namespaces -> { String => String } (25.0) -
self の中で宣言されている名前空間の集合を返します。
....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.get_elements("/root/a").first
p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.att... -
REXML
:: Attributes # [](name) -> String | nil (13.0) -
属性名nameの属性値を返します。
...要な場合は
REXML::Attributes#get_attribute を使ってください。
nameという属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/fo......o"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p a.attributes["att"] # => "<"
p a.attributes["bar:att"] # => "2"
//}... -
REXML
:: Attributes # []=(name , value) (13.0) -
指定した属性を更新します。
...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["att"] = "9"
a.attributes["foo:attt"] = "8"
a # => <a foo:att='1' bar:att='2' att='9' foo:attt='8'/>
//}
@see REXML::Attributes... -
REXML
:: Attributes # delete(attribute) -> REXML :: Element (13.0) -
指定した属性を取り除きます。
...::Attribute オブジェクト)
//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.get_elements("/root/a").first
a.attributes.... -
REXML
:: Attributes # delete _ all(name) -> [REXML :: Attribute] (13.0) -
name という名前を持つ属性をすべて削除します。
...ame 削除する属性の名前
//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.get_elements("/root/a").first
a.attributes.... -
REXML
:: Attributes # each {|name , value| . . . } -> () (13.0) -
各属性の名前と値に対しブロックを呼び出します。
...nded_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.get_elements("/root/a").first
a.attributes.... -
REXML
:: Attributes # get _ attribute(name) -> Attribute | nil (13.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='1' bar:att='2' att='<'/>
</roo... -
REXML
:: Attributes # length -> Integer (13.0) -
属性の個数を返します。
...性の個数を返します。
//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.get_elements("/root/a").first
p a.attributes...