るりまサーチ

最速Rubyリファレンスマニュアル検索!
3684件ヒット [1-100件を表示] (0.033秒)
トップページ > クエリ:rexml[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document to_s
  4. rexml/document clone
  5. rexml/document node_type

キーワード

検索結果

<< 1 2 3 ... > >>

REXML::ParseException#context -> [Integer, Integer, Integer] (11013.0)

パースエラーが起きた(XML上の)場所を返します。

...の)場所を返します。

要素3個の配列で、
[position, lineno, line]
という形で返します。
position, line は
REXML
::ParseException#position
REXML
::ParseException#line
と同じ値です。
lineno は IO#lineno が返す意味での行数です。
通常は line と同じ値...

REXML::ParseException#line -> Integer (11001.0)

パースエラーが起きた(XML上の)場所を行数で返します。

パースエラーが起きた(XML上の)場所を行数で返します。

REXML::ParseException#position -> Integer (11001.0)

パースエラーが起きた(XML上の)場所を先頭からのバイト数で返します。

パースエラーが起きた(XML上の)場所を先頭からのバイト数で返します。

REXML::ParseException#to_s -> String (11001.0)

例外情報を文字列化して返します。

例外情報を文字列化して返します。

REXML::Element#root_node -> REXML::Document | REXML::Node (3227.0)

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

...素が属する文書(REXML::Document) オブジェクトが
返されます。

その要素が属する REXML::Document オブジェクトが存在しない
場合は木構造上のルートノードが返されます。

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

絞り込み条件を変える

REXML::DocType#attributes_of(element) -> [REXML::Attribute] (3142.0)

DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。

...デフォルト値を REXML::Attribute の配列で返します。

名前とデフォルト値のペアは、各 Attribute オブジェクトの
REXML
::Attribute#name と
REXML
::Attribute#value で表現されます。

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

doctype = REXML::Document.new(<<EOS...

REXML::Elements#to_a(xpath = nil) -> [REXML::Element] (3138.0)

すべての子要素の配列を返します。

...要素の配列を返します。

REXML
::Elements#each と同様、REXML::XPath.match などと
異なり、要素以外の子ノードは無視されます。

@param xpath XPath文字列

//emlist[][ruby]{
require 'rexml/document'
require 'rexml/xpath'
doc = REXML::Document.new '<a>sean<b/>elliot...
...t<c/></a>'
doc.root.elements.to_a # => [<b/>, <c/>]
doc.root.elements.to_a("child::node()") # => [<b/>, <c/>]
REXML
::XPath.match(doc.root, "child::node()") # => ["sean", <b/>, "elliott", <c/>]
//}...

REXML::Elements#<<(element = nil) -> REXML::Element (3133.0)

要素 element を追加します。

...要素 element を追加します。

element には文字列もしくは REXML::Element オブジェクトを
指定します。文字列を指定した場合には REXML::Element.new(element)
で生成される要素を追加します。

element を省略した場合は、空の要素が追加...
...ます。

追加された要素が返されます。

@param element 追加する要素

//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new('a')
a.elements.add(REXML::Element.new('b')) # => <b/>
a.to_s # => "<a><b/></a>"
a.elements.add('c') # => <c/>
a.to_s # => "<a><b/><c/></a>"
//...

REXML::Elements#add(element = nil) -> REXML::Element (3133.0)

要素 element を追加します。

...要素 element を追加します。

element には文字列もしくは REXML::Element オブジェクトを
指定します。文字列を指定した場合には REXML::Element.new(element)
で生成される要素を追加します。

element を省略した場合は、空の要素が追加...
...ます。

追加された要素が返されます。

@param element 追加する要素

//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new('a')
a.elements.add(REXML::Element.new('b')) # => <b/>
a.to_s # => "<a><b/></a>"
a.elements.add('c') # => <c/>
a.to_s # => "<a><b/><c/></a>"
//...
<< 1 2 3 ... > >>