696件ヒット
[101-200件を表示]
(0.065秒)
別のキーワード
種類
- インスタンスメソッド (516)
- クラス (84)
- 特異メソッド (60)
- ライブラリ (24)
- 文書 (12)
ライブラリ
- psych (24)
-
rexml
/ document (636)
クラス
-
Psych
:: Nodes :: Document (12) -
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 (24)
- Instruction (12)
- Pretty (12)
- ReFe (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)
- rdoc (12)
-
rexml
/ parsers / sax2parser (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
:: Elements # delete(element) -> Element (60.0) -
element で指定した子要素を取り除きます。
...{
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 , name = nil) -> REXML :: Element | nil (54.0) -
index が指し示している要素を返します。
...require 'rexml/document'
doc = REXML::Document.new '<a><b/><c id="1"/><c id="2"/><d/></a>'
doc.root.elements[1] # => <b/>
doc.root.elements['c'] # => <c id='1'/>
doc.root.elements[2,'c'] # => <c id='2'/>
doc = REXML::Document.new '<a><b><c /><a id="1"/></b></a>'
doc.root.elements["a"]......# => nil
doc.root.elements["b/a"] # => <a id='1'/>
doc.root.elements["/a"] # => <a> ... </>
//}... -
REXML
:: Elements # []=(index , element) (54.0) -
集合に要素 element を追加/更新します。
...xml/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.to_... -
REXML
:: Formatters :: Default (54.0) -
XMLドキュメントを(文字列として)出力するクラスです。
...quire '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<children>......\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_for......matter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren />\n</children>\n</root>\n"
//}... -
REXML
:: Formatters :: Transitive (54.0) -
XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。
...xml/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\n>......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
:: Text . new(arg , respect _ whitespace = false , parent = nil , raw = nil , entity _ filter = nil , illegal = REXML :: Text :: NEEDS _ A _ SECOND _ CHECK) (54.0) -
テキストノードオブジェクトを生成します。
...ルトの場合)、
テキストがどのようにエスケープされるかは、そのノードが属する
文書(REXML::Document)の
DTD(REXML::DocType, REXML::Document#doctype)
で定義されます。DTD が与えられていない場合は、XMLの規格上
以下の実体参照/対応文字......e 'rexml/document'
doc = REXML::Document.new(<<EOS)
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE root [
<!ENTITY p "foobar publisher">
<!ENTITY % q "quzz">
]>
<root />
EOS
REXML::Text.new("&quzz", false, doc.root, false).to_s # => "&&q;"
REXML::Text.new("quzz", false, doc.root, true).t... -
REXML
:: Element # add _ attribute(attr) -> () (48.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'/>
/... -
REXML
:: Element # add _ attribute(key , value) -> () (48.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'/>
/... -
REXML
:: Element # add _ element(element , attrs = nil) -> Element (48.0) -
子要素を追加します。
...][ruby]{
require 'rexml/document'
doc = REXML::Document.new('<a/>')
el = doc.root.add_element 'my-tag' # => <my-tag/>
doc.root.to_s # => "<a><my-tag/></a>"
el = doc.root.add_element 'my-tag', {'attr1'=>'val1', 'attr2'=>'val2'}
# => <my-tag attr1='val1' attr2='val2'/>
doc.root.to_s # => "<a><my-tag/>......<my-tag attr1='val1' attr2='val2'/></a>"
el = REXML::Element.new 'my-tag'
doc.root.add_element el # => <my-tag/>
doc.root.to_s # => "<a><my-tag/><my-tag attr1='val1' attr2='val2'/><my-tag/></a>"
//}
@see REXML::Elements#add, REXML::Element.new...