るりまサーチ

最速Rubyリファレンスマニュアル検索!
110件ヒット [1-100件を表示] (0.159秒)

別のキーワード

  1. matrix l
  2. lupdecomposition l
  3. kernel $-l
  4. _builtin $-l
  5. l matrix

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

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='&lt;'/>
</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'"
//}...

絞り込み条件を変える

<< 1 2 > >>