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