Current section

Files

Jump to
rdf_xml lib rdf xml decoder event_handler.ex
Raw

lib/rdf/xml/decoder/event_handler.ex

defmodule RDF.XML.Decoder.EventHandler do
@moduledoc false
@behaviour Saxy.Handler
alias RDF.XML.Decoder.Grammar
def handle_event(:start_document, _prolog, state), do: {:ok, state}
def handle_event(:end_document, _data, state), do: {:ok, state}
def handle_event(event_type, data, state) do
with {:ok, state} <- Grammar.apply_production(event_type, data, state) do
{:ok, state}
else
error -> {:halt, error}
end
end
end