GIF87a;
require "rexml/document" require "rexml/streamlistener" /\A(\d+)\.(\d+)(?:\.\d+)+\z/ =~ REXML::Version if ([$1.to_i, $2.to_i] <=> [2, 5]) < 0 raise LoadError, "needs REXML 2.5 or later (#{REXML::Version})" end module RSS class REXMLParser < BaseParser class << self def listener REXMLListener end end private def _parse begin REXML::Document.parse_stream(@rss, @listener) rescue RuntimeError => e raise NotWellFormedError.new{e.message} rescue REXML::ParseException => e context = e.context line = context[0] if context raise NotWellFormedError.new(line){e.message} end end end class REXMLListener < BaseListener include REXML::StreamListener include ListenerMixin class << self def raise_for_undefined_entity? false end end def xmldecl(version, encoding, standalone) super(version, encoding, standalone == "yes") # Encoding is converted to UTF-8 when REXML parse XML. @encoding = 'UTF-8' end alias_method(:cdata, :text) end end
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
content | Folder | 0755 |
|
|
dublincore | Folder | 0755 |
|
|
maker | Folder | 0755 |
|
|
0.9.rb | File | 9.36 KB | 0644 |
|
1.0.rb | File | 8.46 KB | 0644 |
|
2.0.rb | File | 2.29 KB | 0644 |
|
atom.rb | File | 22.41 KB | 0644 |
|
content.rb | File | 771 B | 0644 |
|
converter.rb | File | 3.87 KB | 0644 |
|
dublincore.rb | File | 4.18 KB | 0644 |
|
image.rb | File | 4.57 KB | 0644 |
|
itunes.rb | File | 9.96 KB | 0644 |
|
maker.rb | File | 1.75 KB | 0644 |
|
parser.rb | File | 15.47 KB | 0644 |
|
rexmlparser.rb | File | 1.09 KB | 0644 |
|
rss.rb | File | 33.53 KB | 0644 |
|
slash.rb | File | 1.22 KB | 0644 |
|
syndication.rb | File | 1.75 KB | 0644 |
|
taxonomy.rb | File | 2.98 KB | 0644 |
|
trackback.rb | File | 6.56 KB | 0644 |
|
utils.rb | File | 2.61 KB | 0644 |
|
xml-stylesheet.rb | File | 2.13 KB | 0644 |
|
xml.rb | File | 1.47 KB | 0644 |
|
xmlparser.rb | File | 1.55 KB | 0644 |
|
xmlscanner.rb | File | 2.1 KB | 0644 |
|