oga/spec/oga/xml
Yorick Peterse 83f6d5437e Contextual pull parsing.
This adds the ability to more easily act upon specific node types and nestings
when using the pull parsing API.

A basic example of this API looks like the following (only including relevant
code):

    parser.parse do |node|
      parser.on(:element, %w{people person}) do
        people << {:name => nil, :age => nil}
      end

      parser.on(:text, %w{people person name}) do
        people.last[:name] = node.text
      end

      parser.on(:text, %w{people person age}) do
        people.last[:age] = node.text.to_i
      end
    end

This fixes #6.
2014-04-29 23:05:49 +02:00
..
lexer Lex input as a sequence of bytes. 2014-04-17 17:45:05 +02:00
parser First shot at removing the AST layer. 2014-04-21 23:05:39 +02:00
pull_parser Contextual pull parsing. 2014-04-29 23:05:49 +02:00
cdata_spec.rb Contextual pull parsing. 2014-04-29 23:05:49 +02:00
comment_spec.rb Contextual pull parsing. 2014-04-29 23:05:49 +02:00
doctype_spec.rb Contextual pull parsing. 2014-04-29 23:05:49 +02:00
document_spec.rb Expanded tests for XML::Document#inspect. 2014-04-07 20:11:12 +02:00
element_spec.rb Contextual pull parsing. 2014-04-29 23:05:49 +02:00
node_spec.rb Contextual pull parsing. 2014-04-29 23:05:49 +02:00
text_spec.rb Contextual pull parsing. 2014-04-29 23:05:49 +02:00
xml_declaration_spec.rb Contextual pull parsing. 2014-04-29 23:05:49 +02:00