
On 2/12/07, abir basak
Hi, I am at present using spirit for parsing unipen file as specified in http://www.unipen.org/dataformats.html . That is great and quite easy to parse, thanks to spirit. Now I am looking to use spirit for parsing an specific xml file ( w3c inkml file). So my intension is not to have a generic xml parser, rather than a specific xml parser (which also have some BNF grammar) . Anyone had used spirit for domain specific xml parsing? I believe using spirit will make it faster. Also I am interested to parse only a portion of the whole document at a time, and generate data from that portion only, rather generating data for whole DOM (The files are large, 4-20 MB typically)
Spirit is a great parser but if what you are aiming for is speed it's probably not for you. It can be quite slow compared to hand-written parsers (especially with complex grammars). If you still want to use it though, I think I remember one of the spirit examples involving parsing some basic XML. Libxml2's xmlreader gives a forward-only reader that doesn't generate any DOM, with speed that will be hard to beat. It can also validate using a schema, which can be useful if your app ever has a chance of being given an invalid inkml file. -- Cory Nelson