636件ヒット
[1-100件を表示]
(0.159秒)
別のキーワード
種類
- インスタンスメソッド (504)
- クラス (72)
- 特異メソッド (60)
ライブラリ
-
rexml
/ document (636)
クラス
-
REXML
:: Attributes (156) -
REXML
:: CData (36) -
REXML
:: DocType (24) -
REXML
:: Document (12) -
REXML
:: Element (192) -
REXML
:: Elements (72) -
REXML
:: Instruction (24) -
REXML
:: Text (12) -
REXML
:: XPath (36)
キーワード
- Comment (12)
- Default (12)
- Document (12)
- Instruction (12)
- Pretty (12)
- Transitive (12)
- [] (24)
- []= (24)
-
add
_ attribute (24) -
add
_ element (12) - attribute (12)
- content (12)
- delete (24)
-
delete
_ all (12) -
delete
_ element (12) -
delete
_ namespace (12) - each (36)
-
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) - first (12)
-
get
_ attribute (12) -
get
_ attribute _ ns (12) -
get
_ text (12) -
has
_ elements? (12) - length (12)
- match (12)
- namespaces (12)
- new (24)
-
next
_ element (12) - prefixes (12)
- public (12)
-
root
_ node (12) - size (24)
- system (12)
- target (12)
- text (12)
- text= (12)
-
to
_ a (24) -
to
_ s (12) - value (12)
- xpath (12)
検索結果
先頭5件
-
REXML
:: Element # root -> REXML :: Element (26155.0) -
self が属する文書のルート要素を返します。
...][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/grandchi......ldren").first
grandchildren.name # => "grandchildren"
grandchildren.root.name # => "root"
//}... -
REXML
:: Document # root -> REXML :: Element | nil (26101.0) -
文書のルート要素を返します。
文書のルート要素を返します。
文書がルート要素を持たない場合は nil を返します。 -
REXML
:: Element # root _ node -> REXML :: Document | REXML :: Node (14143.0) -
self が属する文書のルートノードを返します。
...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/children/grand......children").first
grandchildren.name # => "grandchildren"
grandchildren.root_node == doc # => true
//}... -
REXML
:: CData . new(text , respect _ whitespace = true , parent = nil) -> REXML :: CData (8060.0) -
text をテキストとして持つ CData オブジェクトを生成します。
...{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root />
EOS
doc.root.add(REXML::CData.new("foo bar baz "))
doc.to_s # => "<root><![CDATA[foo bar baz ]]></root>\n"
doc = REXML::Document.new(<<EOS)
<root />
EOS
doc.root.add(REXML::CData.new("foo bar baz ", true))
doc.root.add(REXML:......:CData.new("foo bar baz ", false))
doc.to_s # => "<root><![CDATA[foo bar baz ]]><![CDATA[foo bar baz ]]></root>\n"
//}... -
REXML
:: Elements # delete(element) -> Element (8054.0) -
element で指定した子要素を取り除きます。
...by]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/><c/><c id="1"/></a>'
b = doc.root.elements[1]
doc.root.elements.delete b # => <b/>
doc.root.to_s # => "<a><c/><c id='1'/></a>"
doc.elements.delete("a/c[@id='1']") # => <c id='1'/>
doc.root.to_s......# => "<a><c/></a>"
doc.root.elements.delete 1 # => <c/>
doc.root.to_s # => "<a/>"
doc.root.elements.delete '/a'
doc.root.to_s # => ""
//}... -
REXML
:: Elements # []=(index , element) (8048.0) -
集合に要素 element を追加/更新します。
...'rexml/document'
doc = REXML::Document.new '<a/>'
doc.root.elements[10] = REXML::Element.new('b')
doc.root.to_s # => "<a><b/></a>"
doc.root.elements[1] # => <b/>
doc.root.elements[1] = REXML::Element.new('c')
doc.root.to_s # => "<a><c/></a>"
doc.root.elements['c'] = REXML::Element.new('d')
doc.root.... -
REXML
:: Formatters :: Default (8048.0) -
XMLドキュメントを(文字列として)出力するクラスです。
...require 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::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<childr......en>\n <grandchildren/>\n</children>\n</root>\n"
output = StringIO.new
default_formatter.write(REXML::XPath.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>\n"
//}... -
REXML
:: Formatters :: Transitive (8048.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
...'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.new
transitive_formatter.write(doc, output)
output.string
# => "<root......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
#... -
REXML
:: Element # add _ attribute(attr) -> () (8042.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<e/>")
doc.root.add_attribute("a", "b"); doc.root # => <e a='b'/>
doc.root.add_attribute("x:a", "c"); doc.root # => <e a='b' x:a='c'/>
doc.root.add_attribute(REXML::Attribute.new("b", "d"))
doc.root # => <e a='b' x:a='c' b='d'/...