JenX, an XML Parser by Jenny Brien

JenX is a SAX-like (event-based) XML parser and Forth Application
Interface for XML.  JenX makes developing an XML application easy and
pleasurable.  JenX was invented by Jenny Brien.  The implementation in
this package is by Leo Wong.  The following comments refer to this
implementation.

Here's a program to display the cast of characters in Twelfth Night:

<code>
\ dp.f Leo Wong  24 May 2001 +
\ Dramatis Personae of a Shakespeare play
\ Twelfth Night from http://www.ibiblio.org/xml/examples/

S" JenX.f" INCLUDED

FALSE VALUE done
: PERSONA   -cBuff ;
: /PERSONA  cBuff @+ CR TYPE ;
: /PERSONAE  TRUE TO done ;

: ?done done IF -cBuff THEN ;
' Xtag IS doTag
' ?done IS doContent

S" t_night.xml" INCLUDED
</code>

JenX treats an XML file like Forth source (the XML file must begin
with: <?xml...).  Programming JenX is essentially defining Forth words
that have the same names as the element names of tags that need to be
handled and defining a word that deals with content.  In the above
example, PERSONA clears the content buffer, /PERSONA displays the content buffer (which contains names of characters in the play), and PERSONAE tells the content handler to clear the content buffer whenever there is content.

JenX doesn't do everything, but it does much in little, and for many
applications, exactly what you want it to do.


Leo Wong hello@albany.net
http://www.albany.net/~hello/
