110件ヒット
[1-100件を表示]
(0.159秒)
ライブラリ
-
rexml
/ document (88) -
rexml
/ sax2listener (11) -
rexml
/ streamlistener (11)
クラス
-
REXML
:: Attribute (33) -
REXML
:: Attributes (11) -
REXML
:: DocType (11) -
REXML
:: Element (33)
モジュール
-
REXML
:: SAX2Listener (11) -
REXML
:: StreamListener (11)
キーワード
-
add
_ attributes (11) - attlistdecl (11)
-
attributes
_ of (11) - delete (11)
-
has
_ attributes? (11) - namespace (11)
- prefix (11)
-
start
_ element (11) -
to
_ string (11)
検索結果
先頭5件
-
REXML
:: Element # attributes -> REXML :: Attributes (24303.0) -
要素が保持している属性の集合を返します。
要素が保持している属性の集合を返します。 -
REXML
:: SAX2Listener # start _ element(uri , localname , qname , attributes) -> () (12303.0) -
要素が開始されたときに呼び出されるコールバックメソッドです。
...列が渡されます。対応する名前空間が存在しない場合は
nil が渡されます
@param localname 接頭辞を取り除いた要素名文字列が渡されます
@param qname 修飾名(qualified-name)文字列、つまり接頭辞を含む文字列が渡されます
@param a... -
REXML
:: Element # has _ attributes? -> bool (12202.0) -
要素が属性を1つ以上持っていれば真を返します。
要素が属性を1つ以上持っていれば真を返します。 -
REXML
:: Element # add _ attributes(attrs) -> () (12126.0) -
要素の属性を複数追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。
...me1" => "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
:: DocType # attributes _ of(element) -> [REXML :: Attribute] (9349.0) -
DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。
...宣言で、 element という名前の要素に対し宣言されている
属性の名前とデフォルト値を REXML::Attribute の配列で返します。
名前とデフォルト値のペアは、各 Attribute オブジェクトの
REXML::Attribute#name と
REXML::Attribute#value で表現......す。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
E......OS
p doctype.attributes_of("book")
# => [author='', title='', publisher='foobar publisher']
p doctype.attributes_of("book")[0].name # => "author"
p doctype.attributes_of("book")[0].value # => ""
//}... -
REXML
:: Attributes # delete(attribute) -> REXML :: Element (9332.0) -
指定した属性を取り除きます。
...REXML::Attribute オブジェクトを指定します
self が属する要素(REXML::Element)を返します。
@param attribute 取り除く属性(文字列もしくは REXML::Attribute オブジェクト)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:......://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.attributes.delete("att") # => <a foo:att='1' bar:att='2'/>
a.attributes.delete("foo:att") # => <a bar:att='2'/>
attr = a.attributes.get_att......ribute("bar:att")
a.attributes.delete(attr) # => <a/>
//}... -
REXML
:: StreamListener # attlistdecl(element _ name , attributes , raw _ content) -> () (6327.0) -
DTDの属性リスト宣言をパースしたときに呼び出されるコールバックです。
...呼び出されるコールバックです。
@param element_name 要素名が文字列で渡されます
@param attributes 属性名とそのデフォルト値の対応が
{ 属性名文字列 => デフォルト値文字列(無ければnil) } という
ハッシュテーブルで渡さ......の文字列がそのまま渡されます
=== 例
<!ATTLIST a att CDATA #REQUIRED xyz CDATA "foobar">
という属性リスト宣言に対しては
element_name: "a"
attributes: {"att"=>nil, "xyz"=>"foobar"}
raw_content: " \n<!ATTLIST a att CDATA #REQUIRED xyz CDATA \"foobar\">"
という... -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (3119.0) -
属性の名前空間の URI を返します。
...nil を返します。
@param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:n......s", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}... -
REXML
:: Attribute # prefix -> String (3019.0) -
属性の名前空間を返します。
...ます。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new( "elns:myelement" )
e.add_attribute( "nsa:a", "aval" )
e.add_attribute( "b", "bval" )
p e.attributes.get_attribute( "a" ).prefix # -> "nsa"
p e.attributes.get_attribute( "b" ).prefix # -> "elns"
a = REXML::Attribute.new... -
REXML
:: Attribute # to _ string -> String (3013.0) -
"name='value'" という形式の文字列を返します。
..."name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//}...