るりまサーチ

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

別のキーワード

  1. json space
  2. state space
  3. json space=
  4. markup space
  5. state space=

検索結果

<< 1 2 3 > >>

REXML::Element#delete_namespace(namespace = "xmlns") -> self (6202.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::Attribute#namespace(arg = nil) -> String | nil (6102.0)

属性の名前空間の 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::Attributes#namespaces -> { String => String } (6102.0)

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

...ist[][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::DocType#namespaces -> nil (6102.0)

nil を返します。

nil を返します。

REXML::Element#add_namespace(prefix, uri) -> self (6102.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) (6102.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#namespace(prefix=nil) -> String (6102.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::Element#namespaces -> {String => String} (6102.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::Element#whitespace -> bool (6102.0)

要素(self)内で空白が考慮されるならば真を返します。

...ます。

これは、
* REXML::Element#context に :respect_whitespace も :compress_whitespace
含まれない
* context の :respect_whitespace に self の要素名が含まれていて、
:compress_whitespace に self の要素名が含まれていない。
「含まれて...
...のには :all が指定されている場合と、
配列に含まれている場合の両方があります。
のいずれかの場合に真を返します。

要素名として REXML::Namespace#expanded_name が使われるので、
名前空間の prefix は判定に影響します。...
<< 1 2 3 > >>