108件ヒット
[1-100件を表示]
(0.093秒)
別のキーワード
ライブラリ
- ビルトイン (24)
-
net
/ http (24) -
rexml
/ document (48) -
rexml
/ streamlistener (12)
クラス
- Hash (24)
-
Net
:: HTTPResponse (24) -
REXML
:: DocType (36) -
REXML
:: Entity (12)
モジュール
キーワード
- body (12)
-
compare
_ by _ identity (12) -
compare
_ by _ identity? (12) - entities (12)
- entitydecl (12)
-
to
_ s (12) - write (12)
検索結果
先頭5件
-
REXML
:: DocType # entity(name) -> String | nil (24232.0) -
name という実体参照名を持つ実体を文字列で返します。
...EXML::Entity#unnormalized 参照)
された文字列が返されます。
name という名前を持つ実体が存在しない場合には nil を返します。
@param name 実体参照名(文字列)
//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "......barbarbarbar">
]>
EOS
p doctype.entity("bar") # => "barbarbar"
p doctype.entity("foo") # => nil
//}... -
Net
:: HTTPResponse # entity -> String | () | nil (21214.0) -
エンティティボディを返します。
...します。
Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。
entity は obsolete です。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.......example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}... -
REXML
:: StreamListener # entitydecl(content) -> () (12243.0) -
DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。
...。
//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<!DOCTYPE root [
<!ENTITY % YN '"Yes"'>
<!ENTITY % YN 'Yes'>
<!ENTITY WhatHeSaid "He said %YN;">
<!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate......tch.xml">
<!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml">
<!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
]>
<root />
EOS
class Listener
include REXML::StreamListener
def entitydecl(conten......arse
# >> ["YN", "\"Yes\"", "%"]
# >> ["YN", "Yes", "%"]
# >> ["WhatHeSaid", "He said %YN;"]
# >> ["open-hatch", "SYSTEM", "http://www.textuality.com/boilerplate/OpenHatch.xml"]
# >> ["open-hatch", "PUBLIC", "-//Textuality//TEXT Standard open-hatch boilerplate//EN", "http://www.textuality.com/boiler... -
Hash
# compare _ by _ identity -> self (12207.0) -
ハッシュのキーの一致判定をオブジェクトの同一性で判定するように変更します。
...メソッドです。
@return selfを返します。
//emlist[例][ruby]{
h1 = { "a" => 100, "b" => 200, :c => "c" }
p h1.compare_by_identity? #=> false
p h1["a"] #=> 100
h1.compare_by_identity
p h1.compare_by_identity? #=> true
p h1["a"] #=> nil # この"a"と最初の"a"とは......違うオブジェクト
p h1[:c] #=> "c" # 同じ内容のシンボルはすべて同一
//}
@see Hash#compare_by_identity?... -
Hash
# compare _ by _ identity? -> bool (12207.0) -
ハッシュがキーの一致判定をオブジェクトの同一性を用いて行っているならば真を返します。
...ハッシュがキーの一致判定をオブジェクトの同一性を用いて行っているならば真を返します。
//emlist[例][ruby]{
h1 = {}
p h1.compare_by_identity? #=> false
h1.compare_by_identity
p h1.compare_by_identity? #=> true
//}
@see Hash#compare_by_identity... -
Net
:: HTTPResponse # body -> String | () | nil (6114.0) -
エンティティボディを返します。
...します。
Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。
entity は obsolete です。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.......example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}... -
REXML
:: Entity # to _ s -> String (6025.0) -
実体宣言を文字列化したものを返します。
...実体宣言を文字列化したものを返します。
@see REXML::Entity#write
//emlist[][ruby]{
e = REXML::ENTITY.new("w", "wee");
p e.to_s # => "<!ENTITY w \"wee\">"
//}... -
REXML
:: DocType # entities -> { String => REXML :: Entity } (3244.0) -
DTD で宣言されている実体の集合を Hash で返します。
...::Entity オブジェクト
を値とするハッシュテーブルです。
これには、XML のデフォルトの実体(gt, lt, quot, apos)も含まれています。
//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS
p doctype.......entities # => { "gt" => #<REXML::Entity: ...>,
# "lt" => #<REXML::Entity: ...>, ... }
p doctype.entities["bar"].to_s # => "<!ENTITY bar \"barbarbarbar\">"
p doctype.entities["gt"].to_s # => "<!ENTITY gt \">\">"
//}... -
REXML
:: DocType # write(output , indent = 0 , transitive = false , ie _ hack = false) -> () (3019.0) -
output に DTD を出力します。
...mlist[][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">
<!ENTITY p "foo......bar publisher">
<!ENTITY % q "quzz">
]>
EOS
doctype.write(STDOUT)
# =>
# <!DOCTYPE books [
# <!ELEMENT book (comment)>
# ....
//}...