るりまサーチ

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

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. win32ole_param to_s
  4. win32ole_param new
  5. win32ole_param output?

ライブラリ

クラス

検索結果

REXML::DocType#attribute_of(element, attribute) -> String | nil (21162.0)

DTD 内の属性リスト宣言で、 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
auth...
...title CDATA #REQUIRED
p
ublisher 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
//}...