るりまサーチ

最速Rubyリファレンスマニュアル検索!
312件ヒット [1-100件を表示] (0.120秒)
トップページ > クエリ:a[x] > ライブラリ:rexml/document[x] > クエリ:namespace[x]

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

検索結果

<< 1 2 3 ... > >>

REXML::Element#namespace(prefix=nil) -> String (24239.0)

self の文脈で prefix が指している名前空間の URI を返します。

...ます。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns='1' xmlns:y='2'><b/><c xmlns:z='3'/><y:d /></a>")
b = doc.elements['//b']
b.namespace # => "1"
b.namespace("y") # => "2"
b.namespace("z") # => nil
d = doc.elements['//y:d']
d.namespace # => "2"
//}...

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

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

...@param arg この値を指定すると、その属性の名前空間でなく、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_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}...

REXML::Element#delete_namespace(namespace = "xmlns") -> self (12440.0)

名前空間を要素から削除します。

...除します。

@param namespace 削除する名前空間の prefix

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
doc.root.delete_namespace
doc.to_s # => "<a xmlns:foo='bar'/>"
doc.root.delete_namespace 'foo'
doc.to_s # => "<a/>"
//}...

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

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

... namespace の uri を指定します。

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

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

//emlist[][ruby]{
require 'rexml/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) (12294.0)

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

... namespace の uri を指定します。

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

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

//emlist[][ruby]{
require 'rexml/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::Attributes#namespaces -> { String => String } (12226.0)

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

...
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.attribu...
...tes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}...

REXML::Element#namespaces -> {String => String} (12214.0)

self の文脈で定義されている名前空間の情報を返します。

...義されている名前空間を、{ prefix => 識別子 }
というハッシュテーブルで返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].namespaces # => {"x"=>"1", "y"=>"2"}
//}...

REXML::DocType#namespaces -> nil (12202.0)

nil を返します。

nil を返します。

REXML::Namespace#name=(name) (12202.0)

名前を設定します。

...名前を設定します。

prefix を持つ名前も持たない名前も受け付けます。

@param name 名前(文字列)...
<< 1 2 3 ... > >>