るりまサーチ

最速Rubyリファレンスマニュアル検索!
792件ヒット [1-100件を表示] (0.018秒)

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

検索結果

<< 1 2 3 ... > >>

REXML::Elements#each(xpath = nil) {|element| ... } -> [REXML::Elements] (15.0)

全ての子要素に対しブロックを呼び出します。

...ストノードなどはすべて無視されることに注意してください。

@param xpath XPath文字列

//emlist[][ruby]{
require
'rexml/document'
require
'rexml/xpath'
doc = REXML::Document.new '<a><b/><c/><d/>sean<b/><c/><d/></a>'
# <b/>,<c/>,<d/>,<b/>,<c/>, <d/> がブロックに渡...

REXML::Elements#to_a(xpath = nil) -> [REXML::Element] (15.0)

すべての子要素の配列を返します。

...:XPath.match などと
異なり、要素以外の子ノードは無視されます。

@param xpath XPath文字列

//emlist[][ruby]{
require
'rexml/document'
require
'rexml/xpath'
doc = REXML::Document.new '<a>sean<b/>elliott<c/></a>'
doc.root.elements.to_a # => [<b/>, <c/>]
doc.root.elements.to...

REXML::Attribute#namespace(arg = nil) -> String | nil (9.0)

属性の名前空間の URI を返します。

...前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。

//emlist[][ruby]{
require
'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_...

REXML::Attribute#prefix -> String (9.0)

属性の名前空間を返します。

...属性の名前空間を返します。

//emlist[][ruby]{
require
'rexml/document'
e = REXML::Element.new( "elns:myelement" )
e.add_attribute( "nsa:a", "aval" )
e.add_attribute( "b", "bval" )
p e.attributes.get_attribute( "a" ).prefix # -> "nsa"
p e.attributes.get_attribute( "b" ).prefix # -> "...

REXML::Attribute#to_string -> String (9.0)

"name='value'" という形式の文字列を返します。

..."name='value'" という形式の文字列を返します。

//emlist[][ruby]{
require
'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}...

絞り込み条件を変える

REXML::Attributes#[](name) -> String | nil (9.0)

属性名nameの属性値を返します。

...さい。

nameという属性名の属性がない場合は nil を返します。

@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:...

REXML::Attributes#[]=(name, value) (9.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' b...

REXML::Attributes#delete(attribute) -> REXML::Element (9.0)

指定した属性を取り除きます。

...ment)を返します。

@param attribute 取り除く属性(文字列もしくは REXML::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' b...

REXML::Attributes#delete_all(name) -> [REXML::Attribute] (9.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' ba...
<< 1 2 3 ... > >>