This is lxml, a library for parsing XML data into Lua tables.
It is based on Expat, an XML parser library:
	https://libexpat.github.io

To build the library and run a simple test, just do make.
If Lua is not installed in /usr/local, tell make:
	make LUA_TOPDIR=/var/tmp/lhf/lua-5.5.0/install

To install the library where Lua can find it, use a variant of these:
	make install
	sudo make install
	sudo make install LIBDIR=/usr/local/lib/lua/5.5

For detailed installation instructions, see
	https://www.tecgraf.puc-rio.br/~lhf/ftp/lua/install.html

For the latest version of this library, see
	https://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lxml

The library exports a single function, xml.load, which parses XML text
in a Lua string and returns a Lua table. Every XML element in the XML
string is represented by a subtable t. The element's name is stored in
t[0]. The element's attributes are stored as key-value pairs in t. The
element's children are stored in t[1], ..., t[#t]. These are text and
sub-elements, in the order they appear in the XML string. If an error
is found, the parse function returns nil, an error message, and the
position of the error in the string.

test.lua shows the library in action. In particular, it shows how to
remove empty strings consisting of whitespace only and how to simplify
the tables by moving string data to table entries. Many but not all XML
files are like that. Neither task is necessary but they can simplify
processing when applicable. In any case, the code in test.lua is just
sample code. Adapt it to your needs.

This code is hereby placed in the public domain and also under the MIT license.
The Expat code in src/ has its own license. See src/COPYING.

Please send comments, suggestions, and bug reports to lhf@tecgraf.puc-rio.br .

xml library:
load(s)	version
