Home | Docs | Availability | CVS | Summary | Discussion | News | Related | 


S-exp-based XML parsing/query/conversion

Get S-exp-based XML parsing/query/conversion at
   SourceForge.net. Fast, secure and Free Open Source software downloads

This project offers tools to inter-convert between an angular-bracket and a more efficient S-expression-based notations for markup documents, and to manipulate and query xML data in Scheme. The main components of the project are SSAX, SXML, SXPath, and SXSLT.

A SSAX functional XML parsing framework consists of a DOM/SXML parser, a SAX parser, and a supporting library of lexing and parsing procedures. The procedures in the package can be used separately to tokenize or parse various pieces of XML documents. The framework supports XML Namespaces, character, internal and external parsed entities, attribute value normalization, processing instructions and CDATA sections. The package includes a semi-validating SXML parser: a DOM-mode parser that is an instantiation of a SAX parser (called SSAX).

SSAX is a full-featured, algorithmically optimal, pure-functional parser, which can act as a stream processor. SSAX is an efficient SAX parser that is easy to use. SSAX minimizes the amount of application-specific state that has to be shared among user-supplied event handlers. SSAX makes the maintenance of an application-specific element stack unnecessary, which eliminates several classes of common bugs. SSAX is written in a pure-functional subset of Scheme. Therefore, the event handlers are referentially transparent, which makes them easier for a programmer to write and to reason about. The more expressive, reliable and easier to use application interface for the event-driven XML parsing is the outcome of implementing the parsing engine as an enhanced tree fold combinator, which fully captures the control pattern of the depth-first tree traversal.

SXML is an abstract syntax tree of an XML document. SXML is also a concrete representation of the XML Infoset in the form of S-expressions.

SXSLT is a manipulation language for XML and SXPath is an XPath-conforming XML query language. Both languages internally rely on SXML as a representation of the XML Infoset.


  

Documentation and tutorials

SXML Tools Tutorial by Dmitry Lizorkin:
<http://modis.ispras.ru/Lizorkin/sxml-tutorial.html>

Main SSAX/SXML page:
<http://okmij.org/ftp/Scheme/xml.html>

XML Matters: Investigating SXML and SSAX: Manipulating XML in the Scheme programming language
by David Mertz, Ph.D. IBM developerWorks article
<http://www.ibm.com/developerworks/xml/library/x-matters31.html>
<http://www.ibm.com/developerworks/jp/xml/library/x-matters31/>[Japanese]

Authoring dynamic websites with SXML by Peter Bex:
<http://more-magic.net/docs/scheme/sxslt.pdf>

Detailed introduction, motivation and real-life case-studies of SSAX, SXML, SXPath and SXSLT.
The paper and the complementary talk presented at the International Lisp Conference 2002.
<http://okmij.org/ftp/papers/SXs.pdf>
<http://okmij.org/ftp/papers/SXs-talk.pdf>

The derivation of the SSAX API and the comparison of SSAX with other functional-style XML parsers and with the Expat
A transcript of a presentation at PADL 2002, the 4th International Symposium on Practical Aspects of Declarative Languages.
<http://okmij.org/ftp/papers/XML-parsing-talk.ps.gz>
The paper (Copyright of Springer-Verlag) is available at:
<http://link.springer.de/link/service/series/0558/tocs/t2257.htm>
<http://okmij.org/ftp/papers/XML-parsing.ps.gz>

SXML tutorial (in Japanese)
<http://homepage1.nifty.com/blankspace/scheme/nsx.html>

SXML, SSAX, and SXML Transforms. Presentation, notes, and exercises
4th December 2002 and 8th January 2003 meetings of the Scheme UK group [by Noel Welsh and Matt Jadud]
<http://schematics.sourceforge.net/scheme-london/>

Advanced SXLST tutorial
<http://okmij.org/ftp/Scheme/sxslt-advanced.scm>
This file describes common patterns of SXSLT on an interesting example. We demonstrate higher-order tags, pre-order and post-order transformations, re-writing of SXML elements in regular and special ways, context-sensitive applications of re-writing rules, and reflection. Although the file is technically a Scheme source code, it is actually a tutorial. Of 357 lines in the file, 241 are comments and 24 are just blank lines. August 2003.

SXSLT: Manipulation Language for XML
<http://okmij.org/ftp/papers/SXSLT-talk.pdf>
A transcript of a presentation at PADL 2003. The talk introduces SXSLT and compares it with XSLT. Our experience and user comments show that SXSLT is expressive and easy to use. We argue that this outcome is a consequence of SXSLT providing right abstractions for XML transformations, of being higher-order, declarative and extensible.


  

SXML-related projects

Sedna - a Native XML DBMS
<http://www.modis.ispras.ru/Development/sedna.htm>
Since version 0.2, Sedna provides the representation of query results in SXML

SXPath library: an implementation of XPath. The SXML query library.
SXPointer: an SXPath-based implementation of XPointer [by Kirill Lisovsky]
<http://metapaper.net/query/>

SXLink: An implementation of W3C XLink [by Dmitry Lizorkin]
<http://metapaper.net/lisovsky/download/contrib/xlink/>

STX: a compiler for a subset of XSLT and an embedding of XSLT into Scheme [by Kirill Lisovsky]
<http://metapaper.net/lisovsky/transform/stx/>

DataGuides: A descriptive database schema for XML/SXML data [by Kirill Lisovsky]
<http://metapaper.net/xml/dg/>

WebIt! - An XML Framework for Scheme [by Jim Bender]
<http://celtic.benderweb.net/webit/>

HtmlPrag: a permissive HTML parser that emits SXML [by Neil W. Van Dyke]
<http://www.neilvandyke.org/htmlprag/>

WebScraperHelper: simple generation of SXPath queries to extract data from (parsed) Web pages [by Neil W. Van Dyke]
<http://www.neilvandyke.org/webscraperhelper/>

sxmlcnv: XML <-> SXML SmartDoc-friendly conversion application [by Kiyoka Nishiyama]
<http://www.netfort.gr.jp/~kiyoka/sxmlcnv/>


  

SXML for static and dynamic websites

This page and all SXML-related pages are authored in SXML.

For more detailed explanation of these projects, see the talk at the International Lisp Conference.


  

Availability

The current released version of SSAX is 5.1. The whole SSAX code is in public domain.

SSAX has been tested on the following Scheme systems:
PLT Scheme, Bigloo, GambitC 4.0, Chicken, Guile, SCM, MIT Scheme 7.5.2, Scheme48, SCSH, Gauche, SISC.
  

Distributions

SSAX download site at SourceForge:
<http://sf.net/project/showfiles.php?group_id=30687>

Kirill Lisovsky's index of various SSAX distributions. Kirill has put together many of those distributions, in particular, the ones for PLT Scheme.
<http://metapaper.net/xml/ssax/>

SSAX/SXML has been integrated into various Scheme systems and, in some cases, become part of the distribution for those systems:


  

CVS Tree

The CVS Tree includes the complete SSAX/SXML code, some documentation, validation tests, as well as several sample applications.

You can browse the files in the CVS tree from any web browser.



Last updated March 9, 2013

oleg-at-okmij.org
Your comments, problem reports, questions are very welcome!

Converted from SXML by SXML->HTML