96件ヒット
[1-96件を表示]
(0.046秒)
ライブラリ
-
rexml
/ document (96)
クラス
-
REXML
:: Attributes (72) -
REXML
:: Element (24)
キーワード
- [] (12)
- []= (12)
- attribute (12)
- delete (12)
-
delete
_ all (12) -
get
_ attribute (12) -
get
_ attribute _ ns (12)
検索結果
先頭5件
- REXML
:: Element # get _ elements(xpath) -> [REXML :: Element] - REXML
:: Attributes # get _ attribute(name) -> Attribute | nil - REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil - REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil - REXML
:: Attributes # [](name) -> String | nil
-
REXML
:: Element # get _ elements(xpath) -> [REXML :: Element] (18113.0) -
xpath にマッチする要素を配列で返します。
...xpath にマッチする要素を配列で返します。
xpath には XPath 文字列を指定します。
@param xpath XPath 文字列
@see REXML::Elements#to_a... -
REXML
:: Attributes # get _ attribute(name) -> Attribute | nil (18.0) -
name という名前の属性を取得します。
...
@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='<'/>
</root>
EOS
a = doc.get_elements("... -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (18.0) -
namespace と name で特定される属性を返します。
...えてしまった場合でも、このメソッドを
使うことで属性を正しく指定することができます。
@param 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.get_elements("/root/a").first
a.attributes.get_attribute_ns("", "att") # => att='<'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.a... -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (18.0) -
name で指定される属性を返します。
...e という属性名を持つ属性を指定できます。
指定した属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xm......lns: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.attribute("att") # => att='<'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att=... -
REXML
:: Attributes # [](name) -> String | nil (12.0) -
属性名nameの属性値を返します。
...返します。
@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.get_elements("/root/a").fi... -
REXML
:: Attributes # []=(name , value) (12.0) -
指定した属性を更新します。
.../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#add... -
REXML
:: Attributes # delete(attribute) -> REXML :: Element (12.0) -
指定した属性を取り除きます。
...します。
文字列もしくは REXML::Attribute オブジェクトを指定します
self が属する要素(REXML::Element)を返します。
@param attribute 取り除く属性(文字列もしくは REXML::Attribute オブジェクト)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML......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:att='2'/>
a.attributes.delete("foo:att") # => <a bar:att='2'/>
attr =... -
REXML
:: Attributes # delete _ all(name) -> [REXML :: Attribute] (12.0) -
name という名前を持つ属性をすべて削除します。
...ます。
@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.get_elements("/root/a").f...