303件ヒット
[201-300件を表示]
(0.101秒)
種類
- インスタンスメソッド (177)
- クラス (66)
- 特異メソッド (49)
- 関数 (11)
ライブラリ
- ビルトイン (61)
-
net
/ imap (11) - pathname (33)
- psych (22)
-
rdoc
/ code _ object (55) -
rexml
/ document (110)
クラス
- Dir (55)
-
Net
:: IMAP :: ThreadMember (11) - Pathname (33)
-
Psych
:: Nodes :: Node (22) -
RDoc
:: CodeObject (55) -
REXML
:: Element (22) -
REXML
:: Parent (22) -
RubyVM
:: AbstractSyntaxTree :: Node (6)
キーワード
- Default (11)
- DocType (11)
- Element (11)
- ExternalEntity (11)
- Pretty (11)
- Transitive (11)
-
document
_ children (11) -
document
_ children= (11) -
document
_ self (11) -
document
_ self= (11) -
each
_ child (50) - entries (7)
-
rb
_ gc _ mark _ children (11) -
remove
_ classes _ and _ modules (11) - root (11)
-
root
_ node (11) - tag (11)
-
to
_ a (11)
検索結果
先頭5件
-
REXML
:: Formatters :: Default (6054.0) -
XMLドキュメントを(文字列として)出力するクラスです。
...XMLドキュメントを(文字列として)出力するクラスです。
REXML::Formatters::Pretty と
異なりテキストの改行や空白を修正せずにそのまま出力します。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::Document.new <......children>
<grandchildren/>
</children>
</root>
EOS
default_formatter = REXML::Formatters::Default.new
output = StringIO.new
default_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren/>\n</children>\n</root>\n"
output = StringIO.new
default_formatter.write(REXML......t(doc, "/root/children"), output)
output.string
# => "<children>\n <grandchildren/>\n</children>"
ie_hack_formatter = REXML::Formatters::Default.new(true)
output = StringIO.new
ie_hack_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren />\n</children>\n</root>\n"... -
REXML
:: Element (6006.0) -
XML の要素(エレメント、element)を表すクラス。
...XML の要素(エレメント、element)を表すクラス。
要素は
* 子要素(children)
* 属性(attributes)
* 名前(name)
を持つものとして特徴付けられます。
また、要素はある別の要素の子となることもできます。... -
REXML
:: ExternalEntity (6006.0) -
DTD 内の宣言でパラメータ実体参照を使って宣言が されているものを表わすクラスです。
...HTMLsymbol が
それにあたります。
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE xhtml [
<!ENTITY % HTMLsymbol PUBLIC......"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
]>
EOS
p doctype.children.find_all{|child| REXML::ExternalEntity === child }.map(&:to_s)
# => ["%HTMLsymbol;"]
//}... -
REXML
:: Element # root _ node -> REXML :: Document | REXML :: Node (3248.0) -
self が属する文書のルートノードを返します。
...self が属する文書のルートノードを返します。
通常はその要素が属する文書(REXML::Document) オブジェクトが
返されます。
その要素が属する REXML::Document オブジェクトが存在しない
場合は木構造上のルートノードが返されま......emlist[][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/child......ren/grandchildren").first
grandchildren.name # => "grandchildren"
grandchildren.root_node == doc # => true
//}... -
REXML
:: Element # root -> REXML :: Element (3148.0) -
self が属する文書のルート要素を返します。
...self が属する文書のルート要素を返します。
//emlist[][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/grandchildren").first
grandchildren.name # => "grandchildren"
grandchildren.root.name # => "root"
//}... -
REXML
:: Formatters :: Transitive (3054.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
...XMLドキュメントをテキストの内容を変えずに
多少の整形を加えて出力するクラスです。
これが有用な場合はあまりないでしょう。
整形されていない XML を整形したいが、
テキストの空白は改行は変えたくない場合には役......な出力結果になるでしょう。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/transitive'
doc = REXML::Document.new <<EOS
<root><children>
<grandchildren foo='bar' />
</children></root>
EOS
transitive_formatter = REXML::Formatters::Transitive.new
output = StringIO.ne......<children\n >\n<grandchildren foo='bar'\n />\n</children\n ></root\n>\n"
print output.string
# >> <root
# >> ><children
# >> >
# >> <grandchildren foo='bar'
# >> />
# >> </children
# >> ></root
# >> >
output = StringIO.new
transitive_formatter.write(REXML::XPath.first(doc, "/root/child... -
REXML
:: Formatters :: Pretty (3024.0) -
XMLドキュメントを(文字列として)見た目良く出力するクラスです。
...Lドキュメントを(文字列として)見た目良く出力するクラスです。
REXML::Formatters::Default と
異なり見た目のためテキストの改行や空白を修正して出力します。
//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/pretty'
doc = REXML......ent.new <<EOS
<root>
<children>
<grandchildren foo='bar'/>
</children>
</root>
EOS
pretty_formatter = REXML::Formatters::Pretty.new
output = StringIO.new
pretty_formatter.write(doc, output)
output.string
# => "<root>\n <children>\n <grandchildren foo='bar'/>\n </children>\n</root>"
# この......出力結果は入力のXMLよりも空白が増えている
//}... -
REXML
:: DocType (3006.0) -
XML の DTD(文書型定義、Document Type Definition)を表すクラスです。
...XML の DTD(文書型定義、Document Type Definition)を表すクラスです。
rexml では DTD は積極的にはサポートされていません。
デフォルトの実体定義(gt, lt, amp, quot apos)の解決のため DTD は
ある程度はサポートされますが、スキーマの定......義や検証をしたい場合は
XML schema や RELAX NG などを使ってください。
子ノード(REXML::Parent#children)として、
* REXML::ElementDecl
* REXML::ExternalEntity
* REXML::Entity
* REXML::NotationDecl
* REXML::AttlistDecl
などを保持しています。... -
Psych
:: Nodes :: Node # tag -> String | nil (124.0) -
ノードに付加されたタグを返します。
...されていない場合は nil を返します。
ast = Psych.parse(<<EOS)
---
- !!str a
- b
EOS
p ast.root.children[0].value # => "a"
p ast.root.children[0].tag # => "tag:yaml.org,2002:str"
p ast.root.children[1].value # => "b"
p ast.root.children[1].tag # => nil... -
Dir
. entries(path , encoding: Encoding . find("filesystem")) -> [String] (106.0) -
ディレクトリ path に含まれるファイルエントリ名の 配列を返します。
...します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
Dir.entries('.') #=> [".", "..", "bar", "foo"]
//}
@see Dir.foreach
@see Dir.children...