るりまサーチ

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

ライブラリ

キーワード

検索結果

<< 1 2 > >>

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

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

...上書きされます。

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

REXML::Element#delete_namespace(namespace = "xmlns") -> self (102.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=...

REXML::Element#whitespace -> bool (29.0)

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

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

これは、
* REXML::Element#context に :respect_whitespace も :compress_whitespace も
含まれない
* context の :respect_whitespace に self の要素名が含まれていて、
:compress_whitespace に self...

REXML::Element#clone -> REXML::Element (17.0)

self を複製して返します。

...self を複製して返します。

複製されるのは名前、属性、名前空間のみです。
子ノードは複製されません。...

REXML::Element#document -> REXML::Document | nil (17.0)

self が属する文書(REXML::Document)オブジェクトを返します。

...self が属する文書(REXML::Document)オブジェクトを返します。

属する文書がない場合には nil を返します。...

絞り込み条件を変える

REXML::Element#has_elements? -> bool (17.0)

self が一つでも子要素を持つならば true を返します。

...self が一つでも子要素を持つならば true を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b/><c>Text</c></a>")
doc.root.has_elements? # => true
doc.elements["/a/b"].has_elements? # => false
# /a/c はテキストノードしか...

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

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

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

prefix を省略すると、デフォルトの名前空間の URI を返します。

prefix で指示される名前空間の宣言が存在しない場合は nil を返します。

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

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

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

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

対象の要素とその外側の要素で定義されている名前空間を、{ prefix => 識別子 }
というハッシュテーブルで返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Documen...

REXML::Element#prefixes -> [String] (17.0)

self の文脈で定義されている prefix を文字列の配列を返します。

...self の文脈で定義されている prefix を文字列の配列を返します。

対象の要素とその外側の要素で定義されている prefix を返します。

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

REXML::Element#root -> REXML::Element (17.0)

self が属する文書のルート要素を返します。

...self が属する文書のルート要素を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root>
<children>
<grandchildren />
</children>
</root>
EOS

children = doc.get_elements("/root/children").first
children.name # => "children"
children.root.name...

絞り込み条件を変える

<< 1 2 > >>