84件ヒット
[1-84件を表示]
(0.077秒)
ライブラリ
-
rexml
/ document (84)
クラス
-
REXML
:: Attributes (60) -
REXML
:: Element (24)
キーワード
- [] (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 _ ns(namespace , name) -> REXML :: Attribute | nil - REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil - REXML
:: Attributes # [](name) -> String | nil - REXML
:: Attributes # delete(attribute) -> REXML :: Element
-
REXML
:: Element # get _ elements(xpath) -> [REXML :: Element] (18107.0) -
xpath にマッチする要素を配列で返します。
...xpath にマッチする要素を配列で返します。
xpath には XPath 文字列を指定します。
@param xpath XPath 文字列
@see REXML::Elements#to_a... -
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="ht......tp://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.attr... -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (18.0) -
name で指定される属性を返します。
...いう属性名を持つ属性を指定できます。
指定した属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:f......oo="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='2'
a... -
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").first... -
REXML
:: Attributes # delete(attribute) -> REXML :: Element (12.0) -
指定した属性を取り除きます。
...ます。
文字列もしくは REXML::Attribute オブジェクトを指定します
self が属する要素(REXML::Element)を返します。
@param attribute 取り除く属性(文字列もしくは REXML::Attribute オブジェクト)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::D......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... -
REXML
:: Attributes # get _ attribute(name) -> Attribute | nil (12.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("...