Packages
fast_xml
1.1.40
1.1.60
1.1.59
1.1.58
1.1.57
1.1.56
1.1.55
1.1.53
1.1.52
1.1.51
1.1.49
1.1.48
1.1.47
1.1.46
1.1.45
1.1.43
1.1.41
1.1.40
1.1.39
1.1.38
1.1.37
1.1.36
1.1.35
1.1.34
1.1.32
1.1.31
1.1.30
1.1.29
1.1.28
1.1.27
1.1.26
1.1.24
1.1.23
1.1.22
1.1.20
1.1.19
1.1.18
1.1.15
1.1.14
1.1.13
1.1.12
1.1.11
1.1.10
1.1.9
1.1.8
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
Fast Expat-based Erlang / Elixir XML parsing library
Current section
Files
Jump to
Current section
Files
lib/fast_xml.ex
defmodule FastXML do
require Record
@doc """
xml element record, composed of fields: name, attrs, children
"""
Record.defrecord :xmlel, Record.extract(:xmlel, from_lib: "fast_xml/include/fxml.hrl")
@type xmlel :: record(:xmlel, name: String.t, attrs: [attr], children: [content])
@type content :: xmlel | cdata
@type cdata :: {:xmlcdata, String.t}
@type attr :: {attribute::String.t, value::String.t}
Record.defrecord :xmlstreamstart, name: "", attrs: []
@type xmlstreamstart :: record(:xmlstreamstart, name: String.t, attrs: [attr])
Record.defrecord :xmlstreamend, name: ""
@type xmlstreamend :: record(:xmlstreamend, name: String.t)
Record.defrecord :xmlstreamerror, error: {0, ""}
@type xmlstreamerror ::record(:xmlstreamerror, error: error)
@type error :: {code::Integer, description::String.t}
def start, do: :application.start(:fast_xml)
def stop, do: :application.stop(:fast_xml)
end
# Elixir oriented data structures:
defmodule FastXML.El do
defstruct name: "", attrs: %{}, children: []
end
defmodule FastXML.StreamStart do
defstruct name: "", attrs: %{}
end
defmodule FastXML.StreamEnd do
defstruct name: ""
end
defmodule FastXML.StreamError do
defstruct code: 0, desc: ""
end