xsl-list
[Top] [All Lists]

Re: [xsl] LUA Table to XML via XSL

2009-02-18 01:59:41
Hello,

Alain a écrit :
Hello experts,

I'd like to convert a LUA table to an equivalent in XML.

Here is what a sample of a LUA table :

LuaTable = {
["Item1"] = 8.52,
["Item2"] = "String",
["Item3"] = {
["Child1"] = 4.5,
["Child2"] = {
["GranChild"] = "That's all folks!\n"
},
["Child3"] = "With UTF-8: en français",
}
} -- this is a comment


Ouput could be

<LuaTable>
<Item1>8.52</Item1>
<Item2>String</Item2>
<Item3>
<Child1>4.5</Child1>
<Child2>
<GranChild>That's all folks!\n</GranChild>
</Child2>
<Child3>With UTF-8: en français</Child3>
</Item3>
</LuaTable> <!-- this is a comment -->


I'll eventually manage to transform that but my question is:

- Do you know if such a transformation already exists (and is available), or some generic interpreter such as the equivalent of YACC ?
If you just add a document element, it's not very difficult to parse the text with XSLT recursive templates to build the corresponding XML. I have already done something like this with XSLT 1.0 for CSS and for XPath 1.0 expressions.

Alain COUTHURES
<agenceXML>
Bordeaux, France
XForms for browsers without plug-in : http://www.agencexml.com/xsltforms

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>