lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2016-06-23 16:03 GMT+02:00 Jay Carlson <nop@nop.com>:
>
> On Jun 23, 2016 1:58 AM, "Dirk Laurie" <dirk.laurie@gmail.com> wrote:
>
>> The annotated list is my favourite Lua structure, e.g.
>> {shape={2,3},1,2,3,4,5,6} for a matrix. It's almost
>> XML-like except that attribute sequence must not
>> matter (and anyway I have yet to see a real-world
>> docspec in which it does).
>
> The order of attributes in XML is not significant.
>
> https://www.w3.org/TR/REC-xml/#sec-starttags

I planned to write about how available XML-to-Lua converters
handle this (and probably still will) but instead will just list what
is available and my initial experience is.

A sample file was made by 'pdfhtml -xml' to the docspec 'pdf2xml.dtd'
that comes with the Poppler uitilities. Its total argument was passed
to each of the routines available.

1. Module 'LuaXML' from the rock "luaxml" compiled but would not
load, giving a message typical of loading in Lua 5.3 a module written
for the 5.1 API and compiled with 5.3 includes.

2. Module 'xmlreader' from rock 'lua-xmlreader' compiled but would not
load, giving a message typical of loading in Lua 5.3 a module written
for the 5.2 API and compiled with 5.3 includes.

3. Module 'dromozoa.xml' from rock 'dromozoa-xml' compiled and
loaded as a table containing
   decode element encode parse selection selector
'luarocks doc dromozoa-xml' tried to run 'notepad' and actually
succeeded (my Ubuntu has wine). The complete documenation
available this way is:
~~~
# dromozoa-xml

XML parser and toolkit.
~~~
The function 'parse' returned two tables.

4. Module 'xml' from the rock 'xml' compiled and loaded as a table
containing
   load VERSION loadpath find BUILD Parser removeNamespace
   dump DESCRIPTION DEPENDS type
The complete contents of 'DESCRIPTION.detailed' is
~~~
This module is part of the Lubyk project.

    Main features are:
     - Fast and easy to use
     - Complete documentation
     - Based on proven code (RapidXML)
     - Full test coverage

    Read the documentation at http://doc.lubyk.org/xml.html.
~~~
The function 'load' returned one table.

5. Function 'convert' (the 5.1 version) from http://lua-users.org/wiki/LuaXml.
This function loaded under Lua 5.3 and returned two tables.

I shall now look for the real documentation on the source websites and
investigate what the tables look like.