462件ヒット
[1-100件を表示]
(0.082秒)
ライブラリ
-
rexml
/ document (462)
キーワード
-
add
_ attribute (22) -
add
_ attributes (11) -
add
_ element (11) -
add
_ namespace (22) - attribute (11)
- attributes (11)
- cdatas (11)
- clone (11)
- comments (11)
- context (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)
-
next
_ element (11) -
node
_ type (11) - prefixes (11)
-
previous
_ element (11) - raw (11)
- root (11)
-
root
_ node (11) - text (11)
- text= (11)
- texts (11)
- whitespace (11)
- write (11)
- xpath (11)
検索結果
先頭5件
-
REXML
:: Element # add _ attribute(attr) -> () (2.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
要素の属性を追加します。
同じ名前の属性がすでにある場合はその属性を新しい
属性で置き換えます。
引数の与えかたは2通りあります。
要素名と値の2つの文字列で渡す方法と REXML::Attribute オブジェクトを
渡す方法です。
文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェクト)
//emlist[][ruby]{
require 'rexml/document'
doc = ... -
REXML
:: Element # add _ attribute(key , value) -> () (2.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
要素の属性を追加します。
同じ名前の属性がすでにある場合はその属性を新しい
属性で置き換えます。
引数の与えかたは2通りあります。
要素名と値の2つの文字列で渡す方法と REXML::Attribute オブジェクトを
渡す方法です。
文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェクト)
//emlist[][ruby]{
require 'rexml/document'
doc = ... -
REXML
:: Element # add _ attributes(attrs) -> () (2.0) -
要素の属性を複数追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...属性の属性名と属性値の対の集合(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 # add _ element(element , attrs = nil) -> Element (2.0) -
子要素を追加します。
...子要素を追加します。
element として追加する要素を指定します。
REXML::Element オブジェクトもしくは文字列を指定します。
element として REXML::Element オブジェクトを指定した場合、それが追加されます。
文字列を指定した場......'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... -
REXML
:: Element # add _ namespace(prefix , uri) -> self (2.0) -
名前空間を要素に追加します。
...上書きされます。
@param prefix 名前空間の prefix
@param uri 名前空間の uri
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo", "bar") # 上と同じ意味
a.add_namespace("twiddle")
a.to_s # => "<a xm... -
REXML
:: Element # add _ namespace(uri) (2.0) -
名前空間を要素に追加します。
...上書きされます。
@param prefix 名前空間の prefix
@param uri 名前空間の uri
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new("a")
a.add_namespace("xmlns:foo", "bar" )
a.add_namespace("foo", "bar") # 上と同じ意味
a.add_namespace("twiddle")
a.to_s # => "<a xm... -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (2.0) -
name で指定される属性を返します。
name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という属性名を持つ属性を指定できます。
指定した属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = R... -
REXML
:: Element # attributes -> REXML :: Attributes (2.0) -
要素が保持している属性の集合を返します。
要素が保持している属性の集合を返します。 -
REXML
:: Element # cdatas -> [REXML :: CData] (2.0) -
すべての cdata 子ノードの配列を返します。
すべての cdata 子ノードの配列を返します。
返される配列は freeze されます。 -
REXML
:: Element # clone -> REXML :: Element (2.0) -
self を複製して返します。
self を複製して返します。
複製されるのは名前、属性、名前空間のみです。
子ノードは複製されません。