a real light-weight parser (was: XML: A outside perspective)

Jean Marc VANEL jean-marc_vanel at effix.fr
Tue Feb 1 17:33:41 GMT 2000







From: THOMAS PASSIN <tpassin at idsonline.com> on 28/01/2000 02:45 PM

Please respond to THOMAS PASSIN <tpassin at idsonline.com>

To:   xml-dev at ic.ac.uk
cc:    (bcc: Jean Marc VANEL/EFFIX/fr)

Subject:  Re: XML: A outside perspective


David Megginson  wrote:
<snip/>

... Eventually, they may choose to use XML-based configuration
> and save formats, but even with an XML parser, that's a lot of hassle
> when they can parse line- and field-oriented files within only a few
> lines of code (and they don't have to bundle a parser library either).

It is feasible to make a real light-weight parser ; the model would be the Javascript parser at http://www.jeremie.com/ , having 388 lines. It has no DOM, but in these 388 lines there are 2 views : an
indented tree view with collapse-expand, and a text view with syntaxic colors, and it works with IE and Netscape.
It would not be too difficult to translate that in C++ or/and Java. It would leave aside the UTF-8 / 16 aspect, but for config. files , it would be allright.


On the other hand, if you translate your line-and-field format directly to
xml - and especially if you keep the xml for each record to a separate line
..... This could be just the thing for a project's configuration files.

It's better to have a real XML parser .


Cheers

Jean-Marc



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN 981-02-3594-1
Please note: New list subscriptions and unsubscriptions
are  now ***CLOSED*** in preparation for list transfer to OASIS.





More information about the Xml-dev mailing list