Class RSS::XMLScanListener
In: lib/rss/xmlscanner.rb
Parent: BaseListener

Methods

Included Modules

XMLScan::Visitor ListenerMixin

Constants

ENTITIES = { 'lt' => '<', 'gt' => '>', 'amp' => '&', 'quot' => '"', 'apos' => '\''

External Aliases

instruction -> on_pi
text -> on_chardata
text -> on_cdata

Public Instance methods

[Source]

    # File lib/rss/xmlscanner.rb, line 95
95:     def on_attr_charref(code)
96:       @current_attr << [code].pack('U')
97:     end
on_attr_charref_hex(code)

Alias for on_attr_charref

[Source]

    # File lib/rss/xmlscanner.rb, line 91
91:     def on_attr_entityref(ref)
92:       @current_attr << entity(ref)
93:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 87
87:     def on_attr_value(str)
88:       @current_attr << str
89:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 83
83:     def on_attribute(name)
84:       @attrs[name] = @current_attr = ''
85:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 73
73:     def on_charref(code)
74:       text([code].pack('U'))
75:     end
on_charref_hex(code)

Alias for on_charref

[Source]

    # File lib/rss/xmlscanner.rb, line 69
69:     def on_entityref(ref)
70:       text(entity(ref))
71:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 65
65:     def on_etag(name)
66:       tag_end(name)
67:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 79
79:     def on_stag(name)
80:       @attrs = {}
81:     end

[Source]

     # File lib/rss/xmlscanner.rb, line 101
101:     def on_stag_end(name)
102:       tag_start(name, @attrs)
103:     end

[Source]

     # File lib/rss/xmlscanner.rb, line 105
105:     def on_stag_end_empty(name)
106:       tag_start(name, @attrs)
107:       tag_end(name)
108:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 49
49:     def on_xmldecl_encoding(str)
50:       @encoding = str
51:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 57
57:     def on_xmldecl_end
58:       xmldecl(@version, @encoding, @standalone == "yes")
59:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 53
53:     def on_xmldecl_standalone(str)
54:       @standalone = str
55:     end

[Source]

    # File lib/rss/xmlscanner.rb, line 45
45:     def on_xmldecl_version(str)
46:       @version = str
47:     end

Private Instance methods

[Source]

     # File lib/rss/xmlscanner.rb, line 111
111:     def entity(ref)
112:       ent = ENTITIES[ref]
113:       if ent
114:         ent
115:       else
116:         wellformed_error("undefined entity: #{ref}")
117:       end
118:     end

[Validate]