View Source yaccety_sax (yaccety_sax v0.2.2)

Link to this section Summary

Link to this section Types

Specs

ext_parser_state() :: parser_state().

Specs

location() :: pos_integer().

Specs

options() ::
    [{whitespace, boolean()} |
     {comments, boolean()} |
     {proc_inst, boolean()} |
     {base, binary()} |
     {dtd, processed_dtd()} |
     {continuation, {Fun :: fun(), State :: any()}} |
     {external, Fun :: fun()}].

Specs

parser_state() :: #ys_state{}.

Specs

processed_dtd() ::
    #{name := undefined | qname(),
      external_id := undefined | {Pub :: binary(), Sys :: binary()},
      elems := #{Name :: binary() := empty | any | mixed | {mixed, [binary()]}},
      atts := #{Elem :: binary() := [term()]},
      nots := #{Name :: binary() := {binary(), binary()}},
      gen_ents := #{Name :: binary() := binary()},
      par_ents := #{Name :: binary() := binary()},
      ref_stack := list(),
      pi_comments := list()}.

Specs

qname() ::
    {Prefix :: binary(), LocalPart :: binary()} |
    {NamespaceUri :: binary(), Prefix :: binary(), LocalPart :: binary()}.

Specs

xml_attribute() :: {Prefix :: binary(), LocalPart :: binary(), Value :: binary()}.

Specs

xml_characters() ::
    #{type := characters,
      line := location(),
      data := binary(),
      cdata := boolean(),
      ignorable := boolean(),
      space := boolean()}.

Specs

xml_comment() :: #{type := comment, line := location(), text := binary()}.

Specs

xml_dtd() :: #{type := dtd, line := location(), proc := undefined | processed_dtd()}.

Specs

xml_endDocument() :: #{type := endDocument, line := location()}.

Specs

xml_endElement() :: #{type := endElement, line := location(), qname := qname()}.

Specs

Specs

xml_namespace() :: {Uri :: binary(), Prefix :: binary()}.
Link to this type

xml_processingInstruction/0

View Source

Specs

xml_processingInstruction() ::
    #{type := processingInstruction, line := location(), target := binary(), data := binary()}.

Specs

xml_startDocument() ::
    #{type := startDocument,
      line := location(),
      version := binary(),
      encoding := binary(),
      enc_set := boolean(),
      standalone := boolean(),
      sa_set := boolean()}.

Specs

xml_startElement() ::
    #{type := startElement,
      line := location(),
      qname := qname(),
      attributes := [xml_attribute()],
      namespaces := [xml_namespace()]}.

Link to this section Functions

Link to this function

event_characters(Data, CData, Ignorable, IsWs, State)

View Source

Specs

event_characters(Data, CData, Ignorable, IsWs, State) -> {Event, State} | State
                    when
                        Data :: binary(),
                        CData :: boolean(),
                        Ignorable :: boolean(),
                        IsWs :: boolean(),
                        State :: ext_parser_state(),
                        Event :: xml_characters().
Link to this function

event_comment(Text, State)

View Source

Specs

event_comment(Text, State) -> {Event, State}
                 when Text :: binary(), State :: ext_parser_state(), Event :: xml_comment().
Link to this function

event_dtd(Processed, State)

View Source

Specs

event_dtd(Processed :: processed_dtd(), State :: ext_parser_state()) ->
             {xml_dtd(), ext_parser_state()}.
Link to this function

event_endDocument(State)

View Source

Specs

event_endDocument(State) -> {Event, State}
                     when State :: ext_parser_state(), Event :: xml_endDocument().
Link to this function

event_endElement(QName, State)

View Source

Specs

event_endElement(QName, State) -> {Event, State}
                    when QName :: qname(), State :: ext_parser_state(), Event :: xml_endElement().
Link to this function

event_processingInstruction(Target, Data, State)

View Source

Specs

event_processingInstruction(Target, Data, State) -> {Event, State}
                               when
                                   Target :: binary(),
                                   Data :: binary(),
                                   State :: ext_parser_state(),
                                   Event :: xml_processingInstruction().
Link to this function

event_startDocument(Version, Encoding, EncSet, StandAlone, StandSet, State)

View Source

Specs

event_startDocument(Version, Encoding, EncSet, StandAlone, StandSet, State) -> {Event, State}
                       when
                           Version :: binary(),
                           Encoding :: binary(),
                           EncSet :: boolean(),
                           StandAlone :: boolean(),
                           StandSet :: boolean(),
                           State :: ext_parser_state(),
                           Event :: xml_startDocument().
Link to this function

event_startElement(QName, Attributes, Namespaces, State)

View Source

Specs

event_startElement(QName, Attributes, Namespaces, State) -> {Event, State}
                      when
                          QName :: qname(),
                          Attributes :: [xml_attribute()],
                          Namespaces :: [xml_namespace()],
                          State :: ext_parser_state(),
                          Event :: xml_startElement().

Specs

next_event(State) -> {Event, State}
              when State :: ext_parser_state(), Event :: xml_event() | {error, no_event}.