504件ヒット
[201-300件を表示]
(0.288秒)
別のキーワード
種類
- インスタンスメソッド (456)
- 特異メソッド (24)
- ライブラリ (12)
- クラス (12)
ライブラリ
-
rexml
/ document (492)
クラス
-
REXML
:: Attributes (144) -
REXML
:: Element (156) -
REXML
:: Elements (168) -
REXML
:: XPath (12)
キーワード
- << (12)
- Elements (12)
- [] (24)
- []= (24)
- add (12)
-
add
_ element (12) - attribute (12)
- collect (12)
- delete (24)
-
delete
_ all (24) -
delete
_ element (12) - each (24)
-
each
_ attribute (12) - empty? (12)
- first (12)
-
get
_ attribute (12) -
get
_ attribute _ ns (12) -
get
_ elements (12) -
has
_ elements? (12) - index (12)
- inject (12)
- length (12)
- namespace (12)
- namespaces (24)
- new (12)
-
next
_ element (12) - prefixes (24)
- root (12)
-
root
_ node (12) - size (24)
-
to
_ a (12) - xpath (12)
検索結果
先頭5件
-
REXML
:: Elements # inject(xpath = nil , initial = nil) {|element| . . . } -> object (11006.0) -
Enumerable#inject と同様、 各子要素に対し畳み込みをします。
...Enumerable#inject と同様、
各子要素に対し畳み込みをします。
xpath を指定した場合は、その XPath 文字列に
マッチする要素に対し同様の操作をします。
@param xpath XPath文字列
@see REXML::Elements#each... -
REXML
:: Elements # empty? -> bool (11000.0) -
子要素を持たない場合に true を返します。
子要素を持たない場合に true を返します。 -
REXML
:: Elements # index(element) -> Integer (11000.0) -
element で指定した要素が何番目の子要素であるかを返します。
element で指定した要素が何番目の子要素であるかを返します。
element が子要素でない場合は -1 を返します。
返り値は 1-origin です。
@param element インデックスを知りたい要素(REXML::Element オブジェクト)
@see REXML::Element#[] -
REXML
:: Element # namespace(prefix=nil) -> String (8018.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 # next _ element -> Element | nil (8018.0) -
次の兄弟要素を返します。
...次の兄弟要素を返します。
次の要素が存在しない場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/>text<c/></a>'
doc.root.elements['b'].next_element # => <c/>
doc.root.elements['c'].next_element # => nil
//}... -
REXML
:: Element # root -> REXML :: Element (8018.0) -
self が属する文書のルート要素を返します。
...ist[][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 # => "root"
grandchildren = doc.get_elements("/root/children/gran... -
REXML
:: Element # root _ node -> REXML :: Document | REXML :: Node (8018.0) -
self が属する文書のルートノードを返します。
...[][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_node == doc # => true
grandchildren = doc.get_elements("/root/children/gr... -
REXML
:: Element # xpath -> String (8018.0) -
文書上の対象の要素にのみマッチする xpath 文字列を返します。
...ます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new('<a><b/><c/></a>')
c = doc.root.elements[2] # <a> .. </a> の中の <c/> 要素
c # => <c/>
c.xpath # => "/a/c"
doc = REXML::Document.new('<a><b/><b/></a>')
b = doc.root.elements[2] # <a> .. </a> の中の2番目の <b/>... -
REXML
:: Attributes # [](name) -> String | nil (8012.0) -
属性名nameの属性値を返します。
...性名(文字列)
//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='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p a.attributes["att"] # =>...