Google

"DTD/xhtml1-strict.dtd">
Class Amrita::Listener
In:
Parent: Object
Methods
doctype    new    pop    push    result    tag_end    tag_start    text    top   
Included modules
Amrita REXML::StreamListener
Public Class methods
new()
    def initialize
      @stack = [ Null ]
    end
Public Instance methods
push(element)
    def push(element)      
      @stack.unshift element
    end
pop()
    def pop
      @stack.shift
    end
top()
    def top
     @stack.first
    end
result()
    def result
      raise "can't happen @stack.size=#{@stack.size}" unless @stack.size == 1
      top
    end
tag_start(name, attrs)
    def tag_start(name, attrs)
      a = attrs.collect do |key, val|
        Attr.new(key, convert(val))
      end
      push e(name, *a)
      push Null
    end
tag_end(name)
    def tag_end(name)
      body = pop
      element = pop
      element.init_body { body }
      push(pop + element)
    end
text(text)
    def text(text)
      push(pop + TextElement.new(convert(text)))
    end
      text += ] encoding="#{encoding}"] if encoding
      s = SpecialElement.new('?', text)
      push(pop + s)
    end
doctype(name, pub_sys, long_name, uri)
    def doctype(name, pub_sys, long_name, uri)
      s = SpecialElement.new('!',
                             ]DOCTYPE #{name} #{pub_sys} #{long_name} #{uri}])
      push(pop + s)
    end