553件ヒット
[1-100件を表示]
(0.026秒)
別のキーワード
種類
- インスタンスメソッド (408)
- 文書 (61)
- 特異メソッド (48)
- クラス (24)
- ライブラリ (12)
ライブラリ
-
rexml
/ document (468) -
rexml
/ streamlistener (12)
クラス
-
REXML
:: AttlistDecl (12) -
REXML
:: Attribute (72) -
REXML
:: Attributes (36) -
REXML
:: CData (24) -
REXML
:: Comment (12) -
REXML
:: DocType (12) -
REXML
:: Element (84) -
REXML
:: Entity (60) -
REXML
:: Instruction (24) -
REXML
:: NotationDecl (24) -
REXML
:: Text (48) -
REXML
:: XMLDecl (24)
モジュール
-
REXML
:: Namespace (12) -
REXML
:: StreamListener (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - Attribute (12)
- Entity (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 3
. 1 . 0 (4) - []= (12)
-
add
_ attribute (24) -
add
_ attributes (12) -
attributes
_ of (12) - content= (12)
- context= (12)
- each (24)
-
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
get
_ text (12) - new (48)
- normalized (12)
- normalized= (12)
- prefix= (12)
- public= (12)
- raw= (12)
-
rexml
/ document (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) - standalone= (12)
- string= (12)
- system= (12)
-
tag
_ start (12) - target= (12)
- text (12)
-
to
_ s (24) -
to
_ string (12) - unnormalized (12)
- value= (12)
- version= (12)
- write (12)
検索結果
先頭5件
-
REXML
:: Text # value -> String (21131.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
:: Entity # value -> String | nil (21113.0) -
実体の値を返します。
...ータ実体参照(parameter entity)のみが展開され、
そうでない実体参照(general entity)は展開されて
いないような値が返されます。
外部実体(external entity)宣言の場合は nil を返します。
@see REXML::Entity#unnormalized, REXML::Entity#normalized... -
REXML
:: Attribute # value -> String (21101.0) -
正規化されていない属性値を返します。
正規化されていない属性値を返します。
属性値の正規化については XML の仕様を参考にしてください。 -
REXML
:: CData # value -> String (18143.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) (9125.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 (6030.0) -
DOM スタイルの XML パーサ。
...サ。
REXML::Document.new で XML 文書から DOM ツリーを
構築し、ツリーのノードの各メソッドで文書の内容にアクセスします。
以下のプログラムではブックマークの XML からデータを取り出します。
//emlist[][ruby]{
require 'rexml/docume......nt'
require '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の公式......</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... -
REXML
:: Attribute . new(attribute , value , parent = nil) -> REXML :: Attribute (3233.0) -
新たな属性オブジェクトを生成します。
...新たな属性オブジェクトを生成します。
2種類の初期化が可能です。
REXML::Attribute オブジェクトを渡した場合は、
属性名とその値がそれから複製されます。
parent で新たに作られる属性オブジェクトが属する
要素が指定で......ソッドは直接は使わず、REXML::Element#add_attribute などを
使うでしょう。
@param attribute_to_clone 複製元の REXML::Attribute オブジェクト
@param attribute 属性名
@param value 属性の値
@param parent 生成される属性が所属する要素(REXML::Element)... -
REXML
:: Entity . new(name , value , parent=nil , reference=false) -> REXML :: Entity (3233.0) -
新たな Entity オブジェクトを生成して返します。
...新たな Entity オブジェクトを生成して返します。
name, value で実体の名前とその値を定義します。
parent はその entity オブジェクトが属するノードを渡します。
reference でその実体宣言がパラメータ実体(parameter entity)かどうか......DTD を含めておいてそれを REXML::Document.new で
パースするようにしてください。
配列を使うほうは rexml のパーサが内部的に利用するため通常は利用しません。
@param name 実体参照の名前
@param value 参照の値
@param parent 親ノー......ド
@param reference パラメータ実体であるかどうかの真偽値
@param array 初期化のための配列
=== 例
「>」「>」 の対応は以下のように実現されます。
REXML::Entity.new("gt", ">")... -
REXML
:: DocType # attributes _ of(element) -> [REXML :: Attribute] (3153.0) -
DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。
...デフォルト値を REXML::Attribute の配列で返します。
名前とデフォルト値のペアは、各 Attribute オブジェクトの
REXML::Attribute#name と
REXML::Attribute#value で表現されます。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS......CDATA #REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS
p doctype.attributes_of("book")
# => [author='', title='', publisher='foobar publisher']
p doctype.attributes_of("book")[0].name # => "author"
p doctype.attributes_of("book")[0].value # => ""
//}...