るりまサーチ

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

別のキーワード

  1. uri build
  2. uri extract
  3. uri new
  4. open-uri open
  5. uri regexp

ライブラリ

モジュール

キーワード

検索結果

REXML::Element#attribute(name, namespace = nil) -> REXML::Attribute | nil (18245.0)

name で指定される属性を返します。

...name で指定される属性を返します。

属性は REXML::Attribute オブジェクトの形で返します。

name は "foo:bar" のように prefix を指定することができます。

namespace で名前空間の URI を指定することで、その名前空間内で
name という...
...空間のURI(文字列)
//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='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attribute("att") # =>...
...att='&lt;'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att='2'
a.attribute("baz") # => nil
//}...

URI::LDAP#attributes=(s) (17123.0)

自身の Attribute を文字列で設定します。

...自身の Attribute を文字列で設定します。

@param s 自身の Attribute を文字列で設定します。...

URI::LDAP#attributes -> String (17117.0)

自身の Attribute を文字列で返します。

...自身の Attribute を文字列で返します。...

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (9233.0)

namespace と name で特定される属性を返します。

...まった場合でも、このメソッドを
使うことで属性を正しく指定することができます。

@param namespace 名前空間(URI, 文字列)
@param name 属性名(文字列)

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://e...
....get_elements("/root/a").first

a.attributes.get_attribute_ns("", "att") # => att='&lt;'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "at...

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

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

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

URI
が定義されていない場合は nil を返します。

@param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
URI が返されます。
通常は省略します。

//emlis...
...t[][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_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}...

絞り込み条件を変える

REXML::Attributes#namespaces -> { String => String } (3007.0)

self の中で宣言されている名前空間の集合を返します。

...self の中で宣言されている名前空間の集合を返します。

返り値は名前空間の prefix をキーとし、URI を値とする
Hash を返します。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xm...
...lns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</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.attributes.namespaces
# => {}
//}...

REXML::SAX2Listener#start_element(uri, localname, qname, attributes) -> () (220.0)

要素が開始されたときに呼び出されるコールバックメソッドです。

...要素が開始されたときに呼び出されるコールバックメソッドです。

@param uri 名前空間のURI文字列が渡されます。対応する名前空間が存在しない場合は
nil が渡されます
@param localname 接頭辞を取り除いた要素名文字列が...
...渡されます
@param qname 修飾名(qualified-name)文字列、つまり接頭辞を含む文字列が渡されます
@param attribute 属性が { 属性名 => 属性値文字列 } という Hash で
で渡されます。...