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:l...@pontex.cz]
Pontex s. r. o.      [mailto:pon...@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.

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to