201件ヒット
[1-100件を表示]
(0.043秒)
種類
- インスタンスメソッド (165)
- ライブラリ (22)
- 文書 (14)
ライブラリ
-
rexml
/ document (154) -
webrick
/ httprequest (11)
クラス
-
REXML
:: Attribute (11) -
REXML
:: Attributes (132) -
REXML
:: Element (11) -
WEBrick
:: HTTPRequest (11)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (6) - [] (11)
- []= (11)
- attributes (11)
- delete (11)
-
delete
_ all (11) - each (11)
-
each
_ attribute (11) -
get
_ attribute (11) -
get
_ attribute _ ns (11) - length (11)
- namespace (11)
- namespaces (11)
-
net
/ http (11) - prefixes (11)
-
rexml
/ document (11) - size (11)
検索結果
先頭5件
- REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil - REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil - REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () - REXML
:: Attributes # get _ attribute(name) -> Attribute | nil - WEBrick
:: HTTPRequest # attributes -> Hash
-
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (18250.0) -
name で指定される属性を返します。
...name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という......<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.attribute("att") # => att='<'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # =>... -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (9256.0) -
namespace と name で特定される属性を返します。
...<<-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_ns("", "att") # => att='<'
a.attributes.get_attribute_ns("http://example.org/foo", "at......t") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (9238.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 foo: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
:: Attributes # get _ attribute(name) -> Attribute | nil (9226.0) -
name という名前の属性を取得します。
...::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'
//}... -
WEBrick
:: HTTPRequest # attributes -> Hash (9100.0) -
@todo ???
@todo ??? -
net
/ http (6298.0) -
汎用データ転送プロトコル HTTP を扱うライブラリです。 実装は 2616 に基きます。
...データ転送プロトコル HTTP を扱うライブラリです。
実装は 2616 に基きます。
=== 使用例
==== ウェブサーバからドキュメントを得る (GET)
//emlist[例1: GET して 表示するだけ][ruby]{
require 'net/http'
print Net::HTTP.get('www.example.com', '/ind......uire 'net/http'
require 'uri'
print Net::HTTP.get(URI.parse('http://www.example.com/index.html'))
//}
//emlist[例3: より汎用的な例][ruby]{
require 'net/http'
require 'uri'
url = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.start(url.host, url.port) {|http|
http.get('/in.......13.4 Form content types
でもそのように書かれています。
ところが、同じ HTML 4.01 Specification の
B.2.2 Ampersands in URI attribute values では、
この `&' がSGMLの文字実体参照で用いられることが指摘されており、
CGIやサーバの実装者に対し... -
REXML
:: Attributes # delete(attribute) -> REXML :: Element (3143.0) -
指定した属性を取り除きます。
...り除きます。
attribute で取り除く属性を指定します。
文字列もしくは REXML::Attribute オブジェクトを指定します
self が属する要素(REXML::Element)を返します。
@param attribute 取り除く属性(文字列もしくは REXML::Attribute オブジェク......o="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.delete("att") # => <a foo:att='1' bar:att='2'/>
a.attributes.delete("foo:att") # => <a bar:att='2'/>
attr = a.attributes.......get_attribute("bar:att")
a.attributes.delete(attr) # => <a/>
//}... -
REXML
:: Attributes # delete _ all(name) -> [REXML :: Attribute] (3113.0) -
name という名前を持つ属性をすべて削除します。
...ml/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.delete_all("att") # => [att='<']
a # => <a foo:att='1' bar:a... -
REXML
:: Attribute # namespace(arg = nil) -> String | nil (3036.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 # [](name) -> String | nil (3024.0) -
属性名nameの属性値を返します。
...属性名nameの属性値を返します。
属性値ではなく REXML::Attribute オブジェクトが必要な場合は
REXML::Attributes#get_attribute を使ってください。
nameという属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
//emlis......'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
p a.attributes["att"] # => "<"
p a.attributes["bar:att"] # => "2"
//}...