308件ヒット
[1-100件を表示]
(0.024秒)
別のキーワード
種類
- インスタンスメソッド (192)
- 文書 (44)
- ライブラリ (24)
- 特異メソッド (24)
- クラス (24)
ライブラリ
- psych (12)
-
rexml
/ document (228)
クラス
-
REXML
:: Attribute (12) -
REXML
:: Attributes (36) -
REXML
:: CData (24) -
REXML
:: DocType (12) -
REXML
:: Element (72) -
REXML
:: Entity (24) -
REXML
:: Text (36)
キーワード
- Entity (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) - Parser (12)
- Ruby用語集 (12)
- []= (12)
-
add
_ attribute (24) -
add
_ attributes (12) -
attributes
_ of (12) - each (12)
-
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
get
_ text (12) - new (24)
-
rdoc
/ parser / c (12) -
rexml
/ document (12) -
ruby 1
. 8 . 4 feature (12) - text (12)
-
to
_ s (24) -
to
_ string (12) - value= (12)
検索結果
先頭5件
-
REXML
:: Text # value -> String (18113.0) -
テキストの内容を非正規化(すべての実体をアンエスケープ)された状態で返します。
...。
このメソッドの返り値では raw モードや entity_filter は無視されます。
@see REXML::Text#raw, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "< & foobar"
t.value # => "< & foobar"
//}... -
REXML
:: CData # value -> String (15125.0) -
テキスト文字列を返します。
...テキスト文字列を返します。
@see REXML::Text#value, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}... -
REXML
:: Text # value=(val) (6119.0) -
テキストの内容を val に変更します。
...非正規化された(エスケープされていない)文字列を渡さなければ
なりません。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("a")
e.add_text("foo")
e[0].value = "bar"
e.to_s # => "<a>bar</a>"
e[0].value = "<a>"
e.to_s # => "<a><a></a>"
//}... -
rexml
/ document (6024.0) -
DOM スタイルの XML パーサ。
...REXML::Document.new で XML 文書から DOM ツリーを
構築し、ツリーのノードの各メソッドで文書の内容にアクセスします。
以下のプログラムではブックマークの XML からデータを取り出します。
//emlist[][ruby]{
require 'rexml/document'
requ......ire 'pp'
Bookmark = Struct.new(:href, :title, :desc)
doc = REXML::Document.new(<<XML)
<?xml version="1.0" encoding="UTF-8" ?>
<xbel version="1.0">
<bookmark href="http://www.ruby-lang.org/ja/">
<title>オブジェクト指向スクリプト言語 Ruby</title>
<desc>Rubyの公式サイト......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
desc_element = bookmark.elements["desc"]
desc... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (131.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...を呼び出します。
key で指定した属性名の属性を持つ要素のみを対象とします。
value を指定すると、keyで指定した属性名を持つ属性の値がvalueである
もののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max......ません)。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
do... -
REXML
:: Attributes # each {|name , value| . . . } -> () (125.0) -
各属性の名前と値に対しブロックを呼び出します。
...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]
end
# => ["... -
REXML
:: Attributes # []=(name , value) (119.0) -
指定した属性を更新します。
...ます。
name で属性の名前を、value で値を更新します。
既に同じ名前の属性がある場合は上書きされ、
そうでない場合は属性が追加されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://exam... -
REXML
:: Element # add _ attribute(key , value) -> () (119.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェクト)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<e/>")
doc.root.add_attribute("a", "b"); doc.root # => <e a='b'/>
doc... -
REXML
:: Entity . new(name , value , parent=nil , reference=false) -> REXML :: Entity (119.0) -
新たな Entity オブジェクトを生成して返します。
...新たな Entity オブジェクトを生成して返します。
name, value で実体の名前とその値を定義します。
parent はその entity オブジェクトが属するノードを渡します。
reference でその実体宣言がパラメータ実体(parameter entity)かどうか......TD を含めておいてそれを REXML::Document.new で
パースするようにしてください。
配列を使うほうは rexml のパーサが内部的に利用するため通常は利用しません。
@param name 実体参照の名前
@param value 参照の値
@param parent 親ノード...