The cl-sxml Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-sxml Reference Manual

This is the cl-sxml Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Jan 09 14:04:10 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

* CL-SXML
CL-SXML implements Oleg Kiselyov's [[http://okmij.org/ftp/Scheme/SXML.html][SXML]], an S-expression-based
rendering of the XML Infoset.  It requires [[https://common-lisp.net/project/cxml/index.html][CXML]] for SAX parsing.

CL-SXML is developed on SBCL, but it has been successfully tested on
Allegro CL, LispWorks, Clozure & CLISP.  It does not currently work
with ECL.

Note: ~CXML:PARSE~ behaves differently with different implementations.
With SBCL & Allegro CL, one can just pass it a string to parse; with
LispWorks one must call ~RUNES:UTF8-STRING-TO-ROD~.

** API
*** Class ~SXML-HANDLER~
**** Class precedence list
~sax:default-handler~, ~sax:content-handler~, ~sax:abstract-handler~,
~sax:sax-parser-mixin~, ~standard-object~, ~t~
**** Description
A CXML SAX handler which produces SXML documents.  The constructor
takes a single initarg, ~:PACKAGE~ (defaults to ~*PACKAGE*~), which
specifies the package to intern symbols into.

An interesting omission in the SXML spec is no support for the XML
DOCTYPE declaration.  The spec does provide for optional annotations,
though, and so I've chosen to use a ~*DOCTYPE*~ annotation to hold
that information.  This may change in the future.

Note that all whitespace is preserved, as required by the XML spec.
This is ugly — yet more proof that S-expressions are preferable to
XML.

**** Example
#+BEGIN_SRC lisp
(cxml:parse "





Here is some text.
"
            (make-instance 'cl-sxml:sxml-handler)
            :entity-resolver (lambda (p s)
                               (declare (ignorable p s))
                               (flexi-streams:make-in-memory-input-stream nil)))
#+END_SRC

Yields:

#+BEGIN_SRC lisp
(*TOP*
 (@
  (*DOCTYPE* "Document" "-//foo.example//An Example//EN"
   "http://foo.example/"))
 (*pi* |top-level| "here's a top-level processing instruction")
 (|doc|
  (@
   (@
    (*namespaces*
     (|http://www.w3.org/1999/xhtml| "http://www.w3.org/1999/xhtml" |h|))))
  "
"
  (|http://www.w3.org/1999/xhtml:html| "
"
   (|http://www.w3.org/1999/xhtml:body| "
"
    (|http://www.w3.org/1999/xhtml:p| (@ (|class| "bar"))
     "Here is some text.")
    "
"))))
#+END_SRC


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-sxml

Author

Bob Uhl <bob.denver.co@gmail.com>

License

GNU General Public License

Description

SXML parsing for Common Lisp

Dependency

cxml

Source

cl-sxml.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-sxml.asd

Location

cl-sxml.asd

Systems

cl-sxml (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-sxml/package.lisp

Parent

cl-sxml (system)

Location

package.lisp

Packages

cl-sxml


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-sxml/cl-sxml.lisp

Dependency

package.lisp (file)

Parent

cl-sxml (system)

Location

cl-sxml.lisp

Exported Definitions

sxml-handler (class)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-sxml

Source

package.lisp (file)

Use List

common-lisp

Exported Definitions

sxml-handler (class)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Classes

Class: sxml-handler ()
Package

cl-sxml

Source

cl-sxml.lisp (file)

Direct superclasses

default-handler (class)

Direct methods
  • characters (method)
  • end-element (method)
  • start-element (method)
  • processing-instruction (method)
  • comment (method)
  • start-dtd (method)
  • end-document (method)
  • start-document (method)
Direct slots
Slot: elements
Slot: package
Initargs

:package

Initform

*package*


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: intern-attribute ATTRIBUTE PACKAGE
Package

cl-sxml

Source

cl-sxml.lisp (file)

Function: make-namespace ATTRIBUTE PACKAGE
Package

cl-sxml

Source

cl-sxml.lisp (file)

Function: namespace-p ATTRIBUTE
Package

cl-sxml

Source

cl-sxml.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-sxml.asd: The cl-sxml<dot>asd file
cl-sxml/cl-sxml.lisp: The cl-sxml/cl-sxml<dot>lisp file
cl-sxml/package.lisp: The cl-sxml/package<dot>lisp file

F
File, Lisp, cl-sxml.asd: The cl-sxml<dot>asd file
File, Lisp, cl-sxml/cl-sxml.lisp: The cl-sxml/cl-sxml<dot>lisp file
File, Lisp, cl-sxml/package.lisp: The cl-sxml/package<dot>lisp file

L
Lisp File, cl-sxml.asd: The cl-sxml<dot>asd file
Lisp File, cl-sxml/cl-sxml.lisp: The cl-sxml/cl-sxml<dot>lisp file
Lisp File, cl-sxml/package.lisp: The cl-sxml/package<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   F   I   M   N  
Index Entry  Section

F
Function, intern-attribute: Internal functions
Function, make-namespace: Internal functions
Function, namespace-p: Internal functions

I
intern-attribute: Internal functions

M
make-namespace: Internal functions

N
namespace-p: Internal functions

Jump to:   F   I   M   N  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   E   P   S  
Index Entry  Section

E
elements: Exported classes

P
package: Exported classes

S
Slot, elements: Exported classes
Slot, package: Exported classes

Jump to:   E   P   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-sxml: The cl-sxml system
cl-sxml: The cl-sxml package
Class, sxml-handler: Exported classes

P
Package, cl-sxml: The cl-sxml package

S
sxml-handler: Exported classes
System, cl-sxml: The cl-sxml system

Jump to:   C   P   S