るりまサーチ

最速Rubyリファレンスマニュアル検索!
143件ヒット [1-100件を表示] (0.168秒)
トップページ > クエリ:I[x] > クエリ:u[x] > クエリ:name[x] > クエリ:namespace[x]

別のキーワード

  1. encoding koi8_u
  2. util u
  3. _builtin koi8_u
  4. matrix u
  5. erb u

ライブラリ

モジュール

検索結果

<< 1 2 > >>

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

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

... URI を返します。

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

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

//emlist[][ruby]{
require 'r...
...exml/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::UndefinedNamespaceException (24000.0)

XMLのパース中に、定義されていない名前空間が現れた場合に発生する 例外です。

XMLのパース中に、定義されていない名前空間が現れた場合に発生する
例外です。

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

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

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

namespace
で名前空間を、 name で prefix を含まない属性名を
指定します。

指定された属性が存在しない場合は nil を返します。

XML プロセッサが prefix を置き換えてしまった場合...
...
使うことで属性を正しく指定することができます。

@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://ex...
...ot/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", "attt") # => nil
//}...

REXML::Attributes#each_attribute {|attribute| ... } -> () (18412.0)

各属性に対しブロックを呼び出します。

...ttribute オブジェクトで渡されます。

//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").firs...
...t

a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

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

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

...れている名前空間の集合を返します。

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

//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

p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}...

絞り込み条件を変える

REXML::Namespace#fully_expanded_name -> String (18301.0)

完全修飾名を返します。

完全修飾名を返します。

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

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

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

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

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

namespace
で名前空間の URI を指定することで、その名前空間内で
name
という...
...できます。

指定した属性名の属性がない場合は nil を返します。

@param name 属性名(文字列)
@param namespace 名前空間の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
//}...

REXML::Element#add_namespace(prefix, uri) -> self (12432.0)

名前空間を要素に追加します。

...prefix と uri を指定します。
引数が1個の場合はデフォルトの namespace uri を指定します。

既に同じ prefix が存在する場合はそれが上書きされます。

@param prefix 名前空間の prefix
@param uri 名前空間の uri

//emlist[][ruby]{
require 're...
...xml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo", "bar") # 上と同じ意味
a.add_namespace("twiddle")
a.to_s # => "<a xmlns:foo='bar' xmlns='twiddle'/>"
a.add_namespace("foo", "baz")
a.to_s # => "<a xmlns:foo='baz' xmlns='twiddle'/>"
//}...

REXML::Element#add_namespace(uri) (12432.0)

名前空間を要素に追加します。

...prefix と uri を指定します。
引数が1個の場合はデフォルトの namespace uri を指定します。

既に同じ prefix が存在する場合はそれが上書きされます。

@param prefix 名前空間の prefix
@param uri 名前空間の uri

//emlist[][ruby]{
require 're...
...xml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo", "bar") # 上と同じ意味
a.add_namespace("twiddle")
a.to_s # => "<a xmlns:foo='bar' xmlns='twiddle'/>"
a.add_namespace("foo", "baz")
a.to_s # => "<a xmlns:foo='baz' xmlns='twiddle'/>"
//}...

REXML::Namespace#prefix=(value) (12206.0)

prefix (前置修飾子) を設定します。

...prefix (前置修飾子) を設定します。

@param value prefix文字列
@see REXML::Namespace#prefix...

絞り込み条件を変える

<< 1 2 > >>