lua-users home
lua-l archive

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


>Has there been any standerd way of representing a XML document in a lua 
>table structure defined yet?

><person id="1234">
>  <name>
>    <first>John</first>
>    <last>Smith</last>
>  </name>
></person>

I don't know anything about XML, but in Lua this info could be represented as

 person{
  id="1234",
  {
   name={first="John", last="Smith"}
  }
 }

The main difference is that I've made the representation "active" at the
top-level, that is, a "person" function will be called when the file is loaded.
On the other hand, why didn't I make "name" active as well? I guess there's
no right answer.
--lhf