852件ヒット
[1-100件を表示]
(0.033秒)
別のキーワード
種類
- インスタンスメソッド (804)
- 特異メソッド (24)
- クラス (12)
- ライブラリ (12)
ライブラリ
-
rexml
/ document (840)
クラス
-
REXML
:: AttlistDecl (24) -
REXML
:: Attribute (12) -
REXML
:: Attributes (60) -
REXML
:: Child (24) -
REXML
:: Comment (12) -
REXML
:: DocType (72) -
REXML
:: Document (36) -
REXML
:: Element (144) -
REXML
:: Elements (48) -
REXML
:: Entity (84) -
REXML
:: Instruction (12) -
REXML
:: NotationDecl (24) -
REXML
:: Parent (144) -
REXML
:: Text (24) -
REXML
:: XMLDecl (36) -
REXML
:: XPath (24)
モジュール
-
REXML
:: Node (48)
キーワード
- <=> (24)
- ExternalEntity (12)
- [] (48)
- attribute (12)
-
attribute
_ of (12) - collect (12)
- content (12)
- context (12)
- delete (12)
-
delete
_ at (12) -
delete
_ attribute (12) -
delete
_ if (24) - doctype (24)
- document (24)
- each (72)
-
each
_ attribute (12) -
each
_ child (24) -
each
_ element (12) -
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) -
each
_ index (24) -
each
_ recursive (12) - encoding (12)
- entity (12)
- external (12)
-
external
_ id (12) -
find
_ first _ recursive (12) - first (12)
-
get
_ attribute (12) -
get
_ attribute _ ns (12) -
get
_ text (12) - index (12)
- inject (12)
- namespace (12)
- ndata (12)
-
next
_ element (12) -
next
_ sibling _ node (12) - normalized (12)
- notation (12)
- parent (12)
-
previous
_ element (12) -
previous
_ sibling _ node (12) - pubid (12)
- public (24)
- ref (12)
- root (12)
-
root
_ node (12) -
stand
_ alone? (12) - standalone (12)
- system (24)
- text (12)
- unnormalized (12)
- value (12)
-
xml
_ decl (12)
検索結果
先頭5件
-
rexml
/ document (38030.0) -
DOM スタイルの XML パーサ。
...スします。
以下のプログラムではブックマークの XML からデータを取り出します。
//emlist[][ruby]{
require 'rexml/document'
require 'pp'
Bookmark = Struct.new(:href, :title, :desc)
doc = REXML::Document.new(<<XML)
<?xml version="1.0" encoding="UTF-8" ?>
<xbel versi......式サイト</desc>
</bookmark>
<bookmark href="http://rurema.clear-code.com/">
<title>最速Rubyリファレンスマニュアル検索! | るりまサーチ</title>
<desc>Rubyリファレンスマニュアルを全文検索できる。
とても便利。
</desc>
</bookmark>
<......bookmark>
<bookmark href="https://rubygems.org/gems/bitclust-core" />
</xbel>
XML
bookmarks = REXML::XPath.match(doc, "/xbel/bookmark").map do |bookmark|
href = bookmark.attribute("href").value
title_element = bookmark.elements["title"]
title = title_element ? title_element.text : nil
de... -
REXML
:: Comment # <=>(other) -> -1 | 0 | 1 (8202.0) -
other と内容(REXML::Comment#string)を比較します。
other と内容(REXML::Comment#string)を比較します。 -
REXML
:: Text # <=>(other) -> -1 | 0 | 1 (8202.0) -
テキストの内容を other と比較します。
テキストの内容を other と比較します。
@param other 比較対象(REXML::Text オブジェクトもしくは文字列) -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (8131.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|e| p e }
# >> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b id='1'/>
# >......> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'/>
//}... -
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (8131.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...e 'rexml/document'
doc = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
# >> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e......}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}... -
REXML
:: Elements # each(xpath = nil) {|element| . . . } -> [REXML :: Elements] (8131.0) -
全ての子要素に対しブロックを呼び出します。
...y]{
require 'rexml/document'
require 'rexml/xpath'
doc = REXML::Document.new '<a><b/><c/><d/>sean<b/><c/><d/></a>'
# <b/>,<c/>,<d/>,<b/>,<c/>, <d/> がブロックに渡される
doc.root.elements.each {|e|p e}
# <b/>, <b/> がブロックに渡される
doc.root.elements.each('b') {|e|p e} #-> Yie......lds b, b elements
# <b/>,<c/>,<d/>,<b/>,<c/>,<d/> がブロックに渡される
doc.root.elements.each('child::node()') {|e|p e}
# <b/>,<c/>,<d/>,"sean",<b/>,<c/>,<d/> がブロックに渡される
REXML::XPath.each(doc.root, 'child::node()'){|node| p node }
//}... -
REXML
:: Attributes # each {|name , value| . . . } -> () (8119.0) -
各属性の名前と値に対しブロックを呼び出します。
...t[][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
a.attributes.each do |name, value|
p [name, value]
e... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (8119.0) -
各属性に対しブロックを呼び出します。
...[][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
a.attributes.each_attribute do |attr|
p [attr.namespa... -
REXML
:: XPath . each(element , path = nil , namespaces = {} , variables = {}) {|e| . . . } -> () (8113.0) -
element の path で指定した XPath 文字列にマッチする各ノード に対してブロックを呼び出します。
...変数名とその値の対応付け
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:x='1'>
<a>
<b>b1</b>
<x:c />
<b>b2</b>
<d />
</a>
<b> b3 </b>
</root>
EOS
REXML::XPath.each(doc, "/root/a/b"){|e| p e.text }
# >> "b1"
# >> "b2"
//}...