Description

Manipulation of eXtended Xml EXPRessions

Author

Tony Garnock-Jones

Version

Usage

(require-extension xxexpr)

Download

xxexpr.egg

Documentation

This extension provides functions for manipulating XML expressions that follow this grammar:

XXEXPR     :== node
node       :== (child . node) | ()
child      :== edge | atom | special
edge       :== (tag . node) | (tag ((attr atom) ...) . node)
             | (tag (@ (attr atom) ...) . node)
atom       :== <non-list>

Note in particular that write-xxexpr and friends take a node as their argument, not an edge.

parameter: (xml-empty-tags-mode [BOOL])
Controls whether empty tags should be displayed as <.../> or as separate open- and close-tags (default is #t).
parameter: (xml-double-quotes-mode [BOOL])
Controls whether attribute values should be enclosed in double or single quotes (default is #f).
procedure: (xxexpr->string EXPR)
Transforms an expression into a string.
procedure: (xxexpr->string/notags EXPR)
Transforms an expression into a string but omit tags from output.
procedure: (write-xxexpr EXPR [PORT])
Writes an XML representation of EXPR to PORT which defaults to the value of (current-output-port).
procedure: (pretty-print-xxexpr EXPR [PORT])
Writes an XML representation of EXPR to PORT with proper indentation.
procedure: (write-xxexpr/notags EXPR [PORT])
Writes an expression to the given port and omits tags.

License

Copyright (C) 2004 Tony Garnock-Jones

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA