256件ヒット
[1-100件を表示]
(0.089秒)
種類
- インスタンスメソッド (198)
- 特異メソッド (33)
- 文書 (14)
- ライブラリ (11)
ライブラリ
-
rexml
/ document (209) -
rexml
/ sax2listener (11) -
rexml
/ streamlistener (11)
クラス
-
REXML
:: Attribute (77) -
REXML
:: Attributes (22) -
REXML
:: DocType (22) -
REXML
:: Element (88)
モジュール
-
REXML
:: SAX2Listener (11) -
REXML
:: StreamListener (11)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (6) -
add
_ attribute (22) -
add
_ attributes (11) - attlistdecl (11)
-
attribute
_ of (11) - attributes (11)
-
attributes
_ of (11) - clone (11)
- delete (11)
-
delete
_ attribute (11) -
each
_ element _ with _ attribute (11) -
has
_ attributes? (11) - namespace (11)
- new (33)
- prefix (11)
-
rexml
/ document (11) -
start
_ element (11) -
to
_ string (11)
検索結果
先頭5件
- REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil - REXML
:: Attribute # element -> REXML :: Element - REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () - REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil - REXML
:: Element # attributes -> REXML :: Attributes
-
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (21332.0) -
name で指定される属性を返します。
...name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という......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
:: Attribute # element -> REXML :: Element (21302.0) -
その属性が属する要素を返します。
その属性が属する要素を返します。 -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (15451.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...h_element_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('... -
REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil (9332.0) -
要素から 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 # attributes -> REXML :: Attributes (9300.0) -
要素が保持している属性の集合を返します。
要素が保持している属性の集合を返します。 -
REXML
:: Element # add _ attribute(attr) -> () (9238.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...方法と REXML::Attribute オブジェクトを
渡す方法です。
文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェク......list[][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) -> () (9238.0) -
要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...方法と REXML::Attribute オブジェクトを
渡す方法です。
文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。
@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェク......list[][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 _ attributes(attrs) -> () (9212.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 # has _ attributes? -> bool (9200.0) -
要素が属性を1つ以上持っていれば真を返します。
要素が属性を1つ以上持っていれば真を返します。 -
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (6501.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
...内の属性リスト宣言で、 element という名前の要素の attribute という
名前の属性のデフォルト値を返します。
elementという名前の要素の属性値は宣言されていない、
elementという名前の要素にはattributeという名前の属性が宣言......の場合は nil を返します。
@param element 要素名(文字列)
@param attribute 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
a......title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS
p doctype.attribute_of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}...