479件ヒット
[1-100件を表示]
(0.050秒)
ライブラリ
-
cgi
/ html (154) - json (11)
- openssl (11)
-
rexml
/ document (198) -
rexml
/ sax2listener (11) -
rexml
/ streamlistener (11) -
rubygems
/ specification (55)
クラス
-
Gem
:: Specification (55) -
JSON
:: State (11) -
REXML
:: Attribute (33) -
REXML
:: Attributes (110) -
REXML
:: DocType (11) -
REXML
:: Element (33)
モジュール
-
CGI
:: HtmlExtension (154) -
REXML
:: SAX2Listener (11) -
REXML
:: StreamListener (11)
キーワード
- << (11)
-
NEWS for Ruby 2
. 6 . 0 (6) - Namespace (11)
- Request (11)
- [] (11)
- []= (22)
- add (11)
-
add
_ attributes (11) -
array
_ attribute (11) - attlistdecl (11)
-
attribute
_ names (11) -
attributes
_ of (11) - checkbox (11)
-
checkbox
_ group (11) -
delete
_ all (11) - each (11)
-
each
_ attribute (11) -
each
_ element _ with _ attribute (11) -
file
_ field (11) -
get
_ attribute (11) -
get
_ attribute _ ns (11) - hidden (11)
- namespace (11)
- namespaces (11)
-
net
/ http (11) -
password
_ field (11) -
radio
_ group (11) -
rdoc
/ parser / ruby (11) -
required
_ attribute (11) -
required
_ attribute? (11) - reset (11)
-
scrolling
_ list (11) -
start
_ element (11) - submit (11)
-
text
_ field (11) - textarea (11)
-
to
_ string (11) - write (11)
検索結果
先頭5件
-
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (18467.0) -
name で指定される属性を返します。
...
name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という......属性名を持つ属性を指定できます。
指定した属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="ht......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
//}... -
Gem
:: Specification . attribute(name) -> () (18202.0) -
デフォルト値を指定したアクセサを定義するために使用します。
...フォルト値を指定したアクセサを定義するために使用します。
以下の副作用があります。
* クラス変数 @@attributes, @@default_value を変更します。
* 通常の属性書き込みメソッドを定義します。
* デフォルト値を持つ属性読... -
Gem
:: Specification . attribute _ names -> Array (12201.0) -
属性名の配列を返します。
属性名の配列を返します。 -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (9455.0) -
namespace と name で特定される属性を返します。
...namespace と name で特定される属性を返します。
namespace で名前空間を、 name で prefix を含まない属性名を
指定します。
指定された属性が存在しない場合は nil を返します。
XML プロセッサが prefix を置き換えてしまった場合......でも、このメソッドを
使うことで属性を正しく指定することができます。
@param namespace 名前空間(URI, 文字列)
@param name 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo".......get_elements("/root/a").first
a.attributes.get_attribute_ns("", "att") # => att='<'
a.attributes.get_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "at... -
REXML
:: Attributes # get _ attribute(name) -> Attribute | nil (9343.0) -
name という名前の属性を取得します。
...name という名前の属性を取得します。
name という名前を持つ属性がない場合は nil を返します。
@param name 属性名(文字列)
@see REXML::Attributes#[]
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.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.attributes.get_attribute("att") # => att='<'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (9220.0) -
各属性に対しブロックを呼び出します。
...各属性に対しブロックを呼び出します。
個々の属性は REXML::Attribute オブジェクトで渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a fo......o:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}... -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (9124.0) -
属性の名前空間の URI を返します。
...//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "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
:: Attributes # namespaces -> { String => String } (9100.0) -
self の中で宣言されている名前空間の集合を返します。
...p://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
p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}... -
REXML
:: DocType # attributes _ of(element) -> [REXML :: Attribute] (6247.0) -
DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。
...宣言されている
属性の名前とデフォルト値を REXML::Attribute の配列で返します。
名前とデフォルト値のペアは、各 Attribute オブジェクトの
REXML::Attribute#name と
REXML::Attribute#value で表現されます。
//emlist[][ruby]{
require 'rexml/docume......CDATA #REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS
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
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (6238.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...lueである
もののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。
max に 0 を指......数
@param name xpath文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_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('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'/>
//}...