From: "Procházka Lukáš Ing. - Pontex s. r. o." <LPr@pontex.cz>
To: ConTeXt <ntg-context@ntg.nl>
Subject: XML and Lua/Ctx
Date: Wed, 14 Nov 2012 16:44:30 +0100 [thread overview]
Message-ID: <op.wnrsog06tpjj8f@lpr> (raw)
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]
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
[-- Attachment #2: Type: text/plain, Size: 227 bytes --]
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.
[-- Attachment #3: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2012-11-14 15:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 15:44 Procházka Lukáš Ing. - Pontex s. r. o. [this message]
2012-11-14 15:50 ` luigi scarso
2012-11-14 15:52 ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-11-14 16:22 ` luigi scarso
2012-11-14 15:45 Procházka Lukáš Ing. - Pontex s. r. o.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.wnrsog06tpjj8f@lpr \
--to=lpr@pontex.cz \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).