Hello, I've read that when Ctx is to process a XML file, the whole XML tree is loaded first and processed as wanted. I'd need to process a XML file which represents an Excel workbook saved as .xml. When working in pure Lua, I'm using Expat library (http://matthewwild.co.uk/projects/luaexpat/index.html) which allow to create a parser with callbacks (e.g. StartElement(), StopElement(), CharacterData()...). It processes the .xml file on-the-go. However, this solution cannot be used with Ctx as it causes Ctx to crash. How to access a XML file loaded and parsed from within Ctx via Lua? I attach a simple Excel XML (for those who are familiar with Excel and don't refuse using it). As an example, I'd need process the attached .xml into a simple Lua table: ---- -- return -- Lua table as a result { workbooks = { [1] = { name = "1", -- No more info is necessary so far, -- I just need to see the way how to access XML elements }, [2] = { name = "Imp", }, [3] = { name = "Exp", }, [4] = { name = "<Template>", }, } } ---- Could anyone experienced kindly present a way how to get such table from the attached Excel XML file? TIA. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 This part of mail contained an attachment with prohibited file name: MIME type: text/xml File name: Test.xls.xml File size: 8.59 kB The attachment was removed by Kerio MailServer 6.6.2 at mail.pontex.cz.
On Wed, Nov 14, 2012 at 4:44 PM, Procházka Lukáš Ing. - Pontex s. r. o. < LPr@pontex.cz> wrote:
Hello,
I've read that when Ctx is to process a XML file, the whole XML tree is loaded first and processed as wanted.
I'd need to process a XML file which represents an Excel workbook saved as .xml.
When working in pure Lua, I'm using Expat library ( http://matthewwild.co.uk/**projects/luaexpat/index.htmlhttp://matthewwild.co.uk/projects/luaexpat/index.html) which allow to create a parser with callbacks (e.g. StartElement(), StopElement(), CharacterData()...).
It processes the .xml file on-the-go.
However, this solution cannot be used with Ctx as it causes Ctx to crash.
Windows , Linux or MacOS ?
On Wed, 14 Nov 2012 16:50:50 +0100, luigi scarso
However, this solution cannot be used with Ctx as it causes Ctx to crash.
Windows , Linux or MacOS ?
WinXP 32b -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
On Wed, Nov 14, 2012 at 4:52 PM, Procházka Lukáš Ing. - Pontex s. r. o. < LPr@pontex.cz> wrote:
On Wed, 14 Nov 2012 16:50:50 +0100, luigi scarso
wrote: However, this solution cannot be used with Ctx as it causes Ctx to crash.
Windows , Linux or MacOS ?
WinXP 32b
hm, I'm still not good enough under windows (but I'm progressing)
participants (2)
-
luigi scarso
-
Procházka Lukáš Ing. - Pontex s. r. o.