lua-users home
lua-l archive

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


On Fri, Feb 7, 2014 at 7:05 AM, Andrew Starks <andrew.starks@trms.com> wrote:
> T has five children: hello, a tag, world, b tag, and how are you?
> So storing text data in negative keys would seem to make less sense. What am
> I missing?

It's fine (I think) to have both 'tags' and text as part of the array,
since they're so easy to distinguish using type().

> Also, I thought white space was significant in generic XML, but could be
> defined by the schema, although I'm pretty sure I'm making that up...

It most definitely is, in general.  So if we're just using it as a
hierarchical data representation, this complicates things - having to
skip whitespace elements. The parser in pl.xml has an option to ignore
elements only containing whitespace, so that when you look at the
children, they are all data elements.

Clearly XML is one of those things in the Lua-niverse that are going
to be continuously reinvented; one of the factors behind this is
precisely that a fully general representation is awkward for
hierarchical data.

steve d.


steve d.