xml

Simple XML Parser (SAX-style events)

Functions

FunctionDescription
_xml_byte_atInternal byte reader.
_xml_copyInternal: copy bytes.
_xml_add_evtInternal: add event.
_xml_tag_name_endInternal: find end of tag name (space or > or /).
_xml_find_ltInternal: find ‘<’ from pos.
_xml_find_gtInternal: find ‘>’ from pos.
_xml_skip_commentInternal: skip comment . Returns position after –>.
_xml_skip_piInternal: skip PI . Returns position after ?>.
_xml_process_tagInternal: process a tag starting at ‘<’. Returns new pos.
xml_parseParse XML buffer into events.
xml_event_countReturn event count.
xml_event_typeReturn event type at index.
xml_event_nameCopy event name/text to out. Return length.
xml_event_textCopy event text to out. Return length.
xml_escapeEscape XML special chars: & < > " '
_xml_check_ltInternal: check 3-char entity after &.
_xml_check_gt
_xml_check_amp
_xml_check_quot
_xml_check_apos
xml_unescapeUnescape XML entities: & < > " '

Details

_xml_byte_at

fn _xml_byte_at(buf: &i8, idx: i64) -> i64

Internal byte reader.

_xml_copy

fn _xml_copy(dst: &i8, doff: i64, src: &i8, soff: i64, n: i64) -> i64

Internal: copy bytes.

_xml_add_evt

fn _xml_add_evt(h: &i64, typ: i64, off: i64, ln: i64) -> i64

Internal: add event.

_xml_tag_name_end

fn _xml_tag_name_end(data: &i8, start: i64, limit: i64) -> i64

Internal: find end of tag name (space or > or /).

_xml_find_lt

fn _xml_find_lt(data: &i8, pos: i64, len: i64) -> i64

Internal: find ‘<’ from pos.

_xml_find_gt

fn _xml_find_gt(data: &i8, pos: i64, len: i64) -> i64

Internal: find ‘>’ from pos.

_xml_skip_comment

fn _xml_skip_comment(data: &i8, pos: i64, len: i64) -> i64

Internal: skip comment . Returns position after –>.

_xml_skip_pi

fn _xml_skip_pi(data: &i8, pos: i64, len: i64) -> i64

Internal: skip PI . Returns position after ?>.

_xml_process_tag

fn _xml_process_tag(h: &i64, data: &i8, pos: i64, len: i64) -> i64

Internal: process a tag starting at ‘<’. Returns new pos.

xml_parse

fn xml_parse(buf: &i8, len: i64) -> &i64

Parse XML buffer into events.

xml_event_count

fn xml_event_count(h: &i64) -> i64

Return event count.

xml_event_type

fn xml_event_type(h: &i64, idx: i64) -> i64

Return event type at index.

xml_event_name

fn xml_event_name(h: &i64, idx: i64, out: &i8) -> i64

Copy event name/text to out. Return length.

xml_event_text

fn xml_event_text(h: &i64, idx: i64, out: &i8) -> i64

Copy event text to out. Return length.

xml_escape

fn xml_escape(buf: &i8, len: i64, out: &i8) -> i64

Escape XML special chars: & < > " '

_xml_check_lt

fn _xml_check_lt(buf: &i8, i: i64) -> i64

Internal: check 3-char entity after &.

_xml_check_gt

fn _xml_check_gt(buf: &i8, i: i64) -> i64

_xml_check_amp

fn _xml_check_amp(buf: &i8, i: i64) -> i64

_xml_check_quot

fn _xml_check_quot(buf: &i8, i: i64) -> i64

_xml_check_apos

fn _xml_check_apos(buf: &i8, i: i64) -> i64

xml_unescape

fn xml_unescape(buf: &i8, len: i64, out: &i8) -> i64

Unescape XML entities: & < > " '