451件ヒット
[1-100件を表示]
(0.151秒)
種類
- インスタンスメソッド (429)
- 定数 (11)
- 特異メソッド (11)
ライブラリ
-
rexml
/ document (451)
キーワード
- UNDEFINED (11)
-
add
_ attribute (22) -
add
_ attributes (11) -
add
_ element (11) -
add
_ namespace (11) - attribute (11)
- attributes (11)
- cdatas (11)
- clone (11)
- comments (11)
- context (11)
-
delete
_ attribute (11) -
delete
_ element (11) -
delete
_ namespace (11) - document (11)
-
each
_ element (11) -
each
_ element _ with _ attribute (11) -
each
_ element _ with _ text (11) - elements (11)
-
get
_ elements (11) -
get
_ text (11) -
has
_ attributes? (11) -
has
_ elements? (11) -
has
_ text? (11) - instructions (11)
- namespace (11)
- namespaces (11)
- new (11)
-
next
_ element (11) -
node
_ type (11) - prefixes (11)
-
previous
_ element (11) - raw (11)
- root (11)
-
root
_ node (11) - text (11)
- texts (11)
- whitespace (11)
- write (11)
- xpath (11)
検索結果
先頭5件
-
REXML
:: Element # prefixes -> [String] (9201.0) -
self の文脈で定義されている prefix を文字列の配列を返します。
...いる prefix を文字列の配列を返します。
対象の要素とその外側の要素で定義されている prefix を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a xmlns:x='1' xmlns:y='2'><b/><c xmlns:z='3'/></a>")
doc.elements['//b'].prefixes #... -
REXML
:: Element # previous _ element -> Element | nil (9201.0) -
前の兄弟要素を返します。
前の兄弟要素を返します。
前の要素が存在しない場合は nil を返します。 -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (6301.0) -
name で指定される属性を返します。
...name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という......。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
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
a.attribute("att") # => att='<'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att='2'
a.attribute("baz") # => nil
//}... -
REXML
:: Element # attributes -> REXML :: Attributes (6301.0) -
要素が保持している属性の集合を返します。
要素が保持している属性の集合を返します。 -
REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil (6301.0) -
要素から key という属性名の属性を削除します。
...。
@param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x='foo' y:x='bar'/>
e.delete_attribute("x")......; e # => <E y:x='bar'/>
//}... -
REXML
:: Element # write(output = $ stdout , indent = -1 , transitive = false , ie _ hack = false) (6202.0) -
このメソッドは deprecated です。 REXML::Formatter を代わりに 使ってください。
...のメソッドは deprecated です。 REXML::Formatter を代わりに
使ってください。
output にその要素を文字列化したものを(子要素を含め)出力します。
@param output 出力先(IO のように << で書き込めるオブジェクト)
@param indent インデン......(-1 だとインデントしない)
@param transitive XMLではインデントのスペースでDOMが変化してしまう場合がある。
これに真を渡すと、XMLのDOMに余計な要素が加わらないように
空白の出力を適当に抑制するようになる
@param... -
REXML
:: Element # add _ attribute(attr) -> () (6201.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...渡す方法と REXML::Attribute オブジェクトを
渡す方法です。
文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジ......ェクト)
//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='... -
REXML
:: Element # add _ attribute(key , value) -> () (6201.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...渡す方法と REXML::Attribute オブジェクトを
渡す方法です。
文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジ......ェクト)
//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='... -
REXML
:: Element # add _ attributes(attrs) -> () (6201.0) -
要素の属性を複数追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...attrs には Hash もしくは Array を指定できます。
Hash の場合は、
{ "name1" => "value1", "name2" => "value2", ... }
という形で、配列の場合は
[ ["name1", "value1"], ["name2", "value2"], ... }
という形で追加/更新する属性を指定します。
@param attrs......する属性の属性名と属性値の対の集合(Array or Hash)
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("e")
e.add_attributes({"a" => "b", "c" => "d"})
e # => <e a='b' c='d'/>
e = REXML::Element.new("e")
e.add_attributes([["a", "b"], ["c", "d"]])
e # => <e a='b' c='d'/>... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (6201.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.eac......ment_with_attribute('id'){|e| p e }
# >> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b id='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id',...