るりまサーチ

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

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document clone
  4. rexml/document to_s
  5. rexml/document node_type

モジュール

キーワード

検索結果

rexml/parsers/streamparser (38048.0)

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

...白や改行もテキストであることに注意してください。

//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
class Listener
include REXML::StreamListener
def initialize
@events = []
end

def text(text)...
...どが
わかります。

//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'

xml = <<EOS
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<!DOCTYPE root SYSTEM "foo" [
<!ELEMENT root...
...ol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
]>
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar"><![CDATA[cdata is here]]>
<a foo:att='1' bar:att='2' att='&lt;'/>
&amp;&amp; <!-- comment here--> &bar;
</root>
E...

REXML::Parsers::StreamParser#parse -> () (8100.0)

入力をパースします。

入力をパースします。

このメソッドの中からコールバックが呼び出されます。

@raise REXML::ParseException XML文書のパースに失敗した場合に発生します
@raise REXML::UndefinedNamespaceException XML文書のパース中に、定義されていない名前空間
が現れた場合に発生します

REXML::Parsers::StreamParser.new(source, listener) -> REXML::Parsers::StreamParser (8100.0)

ストリームパーサオブジェクトを生成します。

ストリームパーサオブジェクトを生成します。

@param source 入力(文字列、IO、IO互換オブジェクト(StringIOなど))
@param listener コールバックオブジェクト

REXML::StreamListener#entitydecl(content) -> () (154.0)

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

...'
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/OpenHatch.xml">
<!ENTITY open-hatch PUBLIC "-//Textuali...
...ty//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(content); p content; end
end
REXML::Parsers::StreamPars...
...eSaid", "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/boilerplate/OpenHatch.xml"]
# >> ["hatch-pic", "SYSTEM", "../grafix/OpenHat...

rexml (42.0)

Pure Ruby の XML パーサです。 DOM スタイルと SAX スタイルの両方をカバーしています。

...xml/parsers/sax2parser
* rexml/parsers/streamparser
のいずれかを用います。

また、それ以外のパーサとして
* rexml/parsers/pullparser
* rexml/parsers/ultralightparser
などもあります。

=== リンク

* REXML Home
http://www.germane-software.com/software/rex...
...ンス
http://www.germane-software.com/software/rexml_doc
日本語訳 http://pub.cozmixng.org/~kou/rexml-doc-ja/
* チュートリアル
http://www.germane-software.com/software/rexml/docs/tutorial.html
日本語訳 http://www.baykit.org/~makotos/cgi-bin/wiliki.cgi?REXML%A5%C1%A5%...

絞り込み条件を変える