What's the best way to parse an XML file into a SKILL or SKILL++ data structure?
I found an old post, listed below, on parsing xml files using xsltproc. However I am receiving errors about the xslt file when I test it on an example xml file. Is there an updated version of this xslt file available?
I've also seen suggestions that a LISP xml parser be used. Does anybody have any experience with going this route? Have you tried to use the closure xml parser for it?
The attachment is a xml reader in Skill that I did as proof-of-concept for automatic parser generation some time ago. The parser itself is of LALR1 type, automata of lexer and parser are generated directly from EBNF. The grammar is visible in the comments at the reduce rules and should cover all of XML1.0 and probably also most of XML1.1 spec (not tested though), but is limited to 8bit extended ASCII characters only.
The reductions are manually written to generate disembodied property lists (and lists of those) out of parsed xml nodes/content/attributes. This could be modified to build plain lists, tables, or whatever structure is needed.
Usage is to call it with the xml in a string or a filename. An optional callback can be given to enable somewhat similar to SAX mode.