[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SXML (was: Re: loading additional code)


On Sun, 6 Jan 2002, Wojciech Sobczuk wrote:

> 	<mz:sometag a "bcd" e "fgh"> content </mz:sometag>
> translates to:
> 	(sometag 'a "bcd" 'e "fgh" content)

You may consider SXML also:
In SXML attribute names may be bound to functions (and evaluated) as well as tag names,
it provides support for Namespaces and PIs, it is highly suitable for XPath queries, etc.
An example is below.

On 6 Jan 2002, David N. Welton wrote:

> Wojciech Sobczuk <sopel@freebsd.hbz.pl> writes:
> > *AND* i need a nice environment to complete two large web projects
> > (and i also need to convince others that it's better than PHP which
> > 'everyone knows')..
> If the group here will pardon some slightly off topic comments, I
> think you need to look at what people like about PHP - to wit, that
> it's easy to get aquainted with and start using, especially for people
> who don't have a lot of programming experience, or for those who have
> seen a little bit of this and that and want to get started quickly.
SXML proves itself really useful for "quick-start" XML-related projects.
I'm using it in production for two years, usually with SXPath and SSAX parser.

XML element (which is also valid XHTML element)

<tr align="left" valign="top">
  <td><a href="http://ssax.sf.net";>link</a></td>

may be represented in SXML as 

   (@ (align "left")       ; List of 
      (valign "top"))      ; attributes
   (td (i "First"))  
   (td (b "Second"))       ; Empty list of attributes may be omitted
   (td (@) (b "Third"))    ; ... or present, it doesn't matter.
   (td (a (@ (href "http://ssax.sf.net";)) "link")))

It may be also queried using SXPath:
("node" is S-expression above)

((sxpath '(td b)) node)
=>  ((b "Second") (b "Third"))

((sxpath '(td a @ href *text*)) node)
=>  ("http://ssax.sf.net";)

Libraries necessary:
(it provides a _minimalistic_ example also)

More information may be found at 

Best regards,