228件ヒット
[1-100件を表示]
(0.026秒)
種類
- インスタンスメソッド (180)
- クラス (24)
- 特異メソッド (12)
- ライブラリ (12)
ライブラリ
-
rexml
/ document (216)
クラス
-
REXML
:: Attributes (144) -
REXML
:: Element (36) -
REXML
:: XPath (12)
キーワード
- Default (12)
- Transitive (12)
- [] (12)
- []= (12)
- attribute (12)
- delete (12)
-
delete
_ all (12) - each (12)
-
each
_ attribute (12) -
get
_ attribute (12) -
get
_ attribute _ ns (12) - length (12)
- namespaces (12)
- prefixes (12)
- rdoc (12)
-
root
_ node (12) - size (12)
検索結果
先頭5件
-
REXML
:: XPath . first(element , path = nil , namespaces = {} , variables = {}) -> Node | nil (18167.0) -
element の path で指定した XPath 文字列にマッチする最初のノードを 返します。
...nt.new(<<EOS)
<root xmlns:x='1'>
<a>
<b>b1</b>
<x:c />
<b>b2</b>
<d />
</a>
<b> b3 </b>
</root>
EOS
a = doc.root.elements[1] # => <a> ... </>
b1 = REXML::XPath.first(a, "b")
b1.text # => "b1"
REXML::XPath.first(doc, "/root/a/x:c") # => <x:c/>
REXML::XPath.first(a, "x:c") # =>......<x:c/>
REXML::XPath.first(a, "y:c") # => nil
REXML::XPath.first(a, "y:c", {"y" => "1"}) # => <x:c/>
b2 = REXML::XPath.first(doc, "/root/a/b[text()=$v]", {}, {"v" => "b2"})
b2 # => <b> ... </>
b2.text # => "b2"
//}... -
REXML
:: Element # root -> REXML :: Element (18161.0) -
self が属する文書のルート要素を返します。
...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 # => "g......randchildren"
grandchildren.root.name # => "root"
//}... -
REXML
:: Element # root _ node -> REXML :: Document | REXML :: Node (6149.0) -
self が属する文書のルートノードを返します。
...ML::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/grandchildren").first
grandchildren.name # =>......"grandchildren"
grandchildren.root_node == doc # => true
//}... -
REXML
:: Formatters :: Default (48.0) -
XMLドキュメントを(文字列として)出力するクラスです。
...XML::Document.new <<EOS
<root>
<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.n......first(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... -
REXML
:: Formatters :: Transitive (48.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
...<<EOS
<root><children>
<grandchildren foo='bar' />
</children></root>
EOS
transitive_formatter = REXML::Formatters::Transitive.new
output = StringIO.new
transitive_formatter.write(doc, output)
output.string
# => "<root\n><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/children"), output)
output.string
# => "<children\n>\n<grandchildren foo='bar'\n /... -
rdoc (36.0)
-
RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。
...ットを指定します。デフォルトは rdoc です。
markdown、rd、rdoc、tomdoc のいずれかから選択できます。
: --root root
Root of the source tree documentation will be generated for. Set this
when building documentation outside the source directory. Default is
t......FAQ or other pages not associated with
a class live. Set this when you don't store such files at your
project root. NOTE: Do not use the same file name in the page dir
and the root of your project
: --copy-files path
path で指定したファイルかディレクトリを出力先のデ......です。
<tt>--output</tt> <i>name [, name]</i>::
specify the name of one or more output files. If multiple
files are present, the first is used as the index.
<tt>--quiet:</tt>:: do not output the names, sizes, byte counts,
index areas, or bit ratios of units... -
REXML
:: Attributes # namespaces -> { String => String } (30.0) -
self の中で宣言されている名前空間の集合を返します。
...quire '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 doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/f... -
REXML
:: Attributes # prefixes -> [String] (30.0) -
self の中で宣言されている prefix の集合を 文字列の配列で返します。
...quire '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 doc.root.attributes.prefixes # => ["foo", "bar"]
p a.attributes.p... -
REXML
:: Attributes # [](name) -> String | nil (24.0) -
属性名nameの属性値を返します。
...]{
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"] # => "<"
p a.attributes["bar:att"] # =>...