Andreas Vox <[EMAIL PROTECTED]> writes:

| John Levon <[EMAIL PROTECTED]> writes:
>
| | 
| | On Sat, Oct 16, 2004 at 09:42:20AM +0100, Angus Leeming wrote:
| | 
| | > Is the plan to feed the dtd to the parser, so that it parses only lyx docs
| | > and not some other well formed but otherwise arbitrary file?
| | > 
| | > I was thinking about the best way to proceed on the way home last night. Do
| | > we really need to write our own xml parser when there are many *good* and
| | > *proven* ones out there already. Parsing the thing isn't / shouldn't be a
| | > problem. Turning that into a LyX data structure in memory is the problem.
>
| I would support this view. For XML a Spirit parser would be at the wrong level
| of abstraction. For most parsing the tokens are characters or keywords, but
| for XML the token level would be more like the events expat, libxml or SAX
| feed to the handlers.
>
| | 
| | Using an off the shelf  parser actually handles all sorts of freaky
| | things we shouldn't worry it. It's IMHO a requirement that we use one...
| | 
| | > Given that expat already has the machinery we need, so that all you need do
| | > is register handler functions with the parser, I'd start off with that.
| | 
| | Or we could use libxml2 which seems to be everywhere?
| | 
>
| I browsed the homepages of expat / libxml / SAX / Xerces / Arabica
| last night and would also support libxml2. My impressions in detail:
>
| expat: easy C library for XML parsing
| libxml: easy C library for XML parsing, but very complete and contains XSLT
| SAX: just a specification, need Xerces or Arabica for actual parsing
| Xerces: browsing the C++ APIs is a nightmare, too complicated
| Arabica: wrapper to expat/libxml/Xerces, but does not appear to be in a 
| stable state
>
| This is just a first impression and I certainly haven't used any of those.
| The deciding think for libxml2 is the XSLT processor, it would be just cool
| to have that in LyX.

I disagree. LyX is not XSLT, espescially not when it can more easily
be handled _outside_ of lyx.

And I find the interface of libxml a lot harder for simple xml parsing
than expat.

-- 
        Lgb

Reply via email to