るりまサーチ

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

別のキーワード

  1. rexml notationdecl
  2. notationdecl name
  3. notationdecl to_s
  4. notationdecl system

検索結果

REXML::NotationDecl.new(name, middle, pub, sys) -> REXML::NotationDecl (21218.0)

NotationDecl オブジェクトを生成します。

...NotationDecl オブジェクトを生成します。

@param name 記法名(文字列)
@param middle 種別("PUBLIC" もしくは "SYSTEM")
@param pub 公開識別子(文字列)
@param sys URI(文字列)...

REXML::NotationDecl (6006.0)

DTD の記法宣言を表すクラスです。

...DTD の記法宣言を表すクラスです。


//emlist[][ruby]{
require 'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!NOTATION type-image-svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!NOTATION type-image-g...

rexml/parsers/streamparser (36.0)

ストリーム式の XML パーサ。

...ソッドをオーバーライドしたクラスのオブジェクトを
コールバックオブジェクトとして REXML::Parsers::StreamParser.new
に渡します。

REXML::Parsers::StreamParser#parse を呼び出すと
パースが開始しその結果によってコールバックが呼び...
...="red">
<comment>comment here</comment>
</member>
<member name="banana" color="yellow"/>
</members>
EOS
listener = Listener.new
REXML::Parsers::StreamParser.new(xml, listener).parse
listener.events
# => ["tag_start[members]",
# "text[\n ]",
# "tag_start[member]",
# "text[\n ]...
..., "barbarbarbar"]]
# >> [:attlistdecl, "a", {"att"=>nil, "xyz"=>"foobar"}, " \n <!ATTLIST a att CDATA #REQUIRED xyz CDATA \"foobar\">"]
# >> [:notationdecl, ["foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]]
# >> [:entitydecl, ["HTMLsymbol", "PUBLIC", "-//W3C//ENTITIES Symbols for XHTML//E...

rexml/parsers/sax2parser (24.0)

SAX2 と同等の API を持つストリーム式の XML パーサ。

...よりは高機能です。

//emlist[][ruby]{
require 'rexml/parsers/sax2parser'
require 'rexml/sax2listener'

parser = REXML::Parsers::SAX2Parser.new(<<XML)
<root n="0">
<a n="1">111</a>
<b n="2">222</b>
<a n="3">333</a>
</root>
XML

elements = []
parser.listen(:start_element){|uri, localnam...
...name, *args]
end
def respond_to_missing?(name, include_private)
name != :call
end
end

parser = REXML::Parsers::SAX2Parser.new(xml)
parser.listen(Listener.new)
parser.parse
# >> [:start_document]
# >> [:xmldecl, "1.0", "UTF-8", nil]
# >> [:progress, 39]
# >> [:characters, "\n"]
# >> [:prog...
...> [:attlistdecl, "a", {"att"=>nil, "xyz"=>"foobar"}, " \n <!ATTLIST a att CDATA #REQUIRED xyz CDATA \"foobar\">"]
# >> [:progress, 245]
# >> [:notationdecl, "foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]
# >> [:progress, 683]
# >> [:entitydecl, "HTMLsymbol", "PUBLIC", "-//W3C//ENTITIES S...

rexml/parsers/pullparser (18.0)

プル方式の XML パーサ。

...ォルト値文字列(なければnil) } という Hash
: elementdecl (宣言文字列)
DTDの要素宣言
: entitydecl
DTDの実体宣言
: notationdecl (記法名文字列, "PUBLIC" | "SYSTEM" | nil, 公開識別子文字列 | nil, URI文字列 | nil)
DTDの記法宣言
: cdata (テキスト...
...[cdata is here]]>
<a foo:att='1' bar:att='2' att='&lt;'/>
&amp;&amp; <!-- comment here--> &bar;
</root>
EOS

parser = REXML::Parsers::PullParser.new(xml)
while parser.has_next?
p parser.pull
end
# >> xmldecl: ["1.0", "UTF-8", nil]
# >> text: ["\n", "\n"]
# >> processing_instruction: ["xml-styl...
..."bar", "barbarbarbar"]
# >> attlistdecl: ["a", {"att"=>nil, "xyz"=>"foobar"}, " \n <!ATTLIST a att CDATA #REQUIRED xyz CDATA \"foobar\">"]
# >> notationdecl: ["foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]
# >> entitydecl: ["HTMLsymbol", "PUBLIC", "-//W3C//ENTITIES Symbols for XHTML//EN"...

絞り込み条件を変える

rexml/parsers/ultralightparser (18.0)

パース結果を配列で作られた木構造により返すパーサ。

...パース結果を配列で作られた木構造により返すパーサ。

REXML::Parsers::UltraLightParser.new でパーサオブジェクトを
生成し、REXML::Parsers::UltraLightParser#parse でパースし
その結果の木構造を返します。

===[a:nodes] ノードの表現
REXML::Pa...
...ればnil) } という Hash
: [:elementdecl, 宣言文字列]
DTDの要素宣言
: [:entitydecl, *パラメータ]
DTDの実体宣言
: [:notationdecl, 記法名文字列, "PUBLIC" | "SYSTEM" | nil, 公開識別子文字列 | nil, URI文字列 | nil]
DTDの記法宣言
: [:cdata, テキスト...
...では省略されています。

//emlist[][ruby]{
require 'rexml/parsers/ultralightparser'
require 'pp'
parser = REXML::Parsers::UltraLightParser.new(<<XML)
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<a n="1">xyz</a>
<b m="2" />
</root>
XML
pp parser.parse
# >> [[:xmldecl, "1.0", "UTF-8",...