るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.025秒)
トップページ > クエリ:comment[x] > クエリ:attribute_of[x]

別のキーワード

  1. attribute new
  2. element add_attribute
  3. rexml/document attribute
  4. attribute value
  5. rexml/document add_attribute

ライブラリ

クラス

検索結果

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

DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。

...[
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
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
//}...