The cl-fxml Reference Manual

Table of Contents

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

The cl-fxml Reference Manual

This is the cl-fxml Reference Manual, version 1.2.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 14:47:59 2021 GMT+0.


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

1 Introduction

Installation

(ql:quickload "cl-fxml")

Usage

For template code interleaved with normal code including top-level forms use:

(named-readtables:in-readtable cl-fxml:syntax)

or wrap you normal code interleaving template code with with-xml:

(cl-fxml:with-xml
  ((:p)
    "Paragraph number one.))

The variable cl-fxml:*new-line-after-opening* controls whether to make a newline after > of the opening tags.

Examples

((:html)
  ((:head)
    ((:title) "Html example"))
  ((:body)
    ((:a :href "#") "Lorem ipsum dolor sit amet")))

Output redirection to string:

(let ((str (make-array '(0) :element-type 'base-char :fill-pointer 0 :adjustable t)))
  (with-output-to-string (*standard-output* str)
    ((:html)
      ((:head)
        ((:title) "Html example"))
      ((:body)
        ((:a :href "#") "Lorem ipsum dolor sit amet"))))
  str)

Interleaving code:

(let ((x 25))
  ((:root :x x 'attribute-without-value)
    (loop for i below 10
          do ((:element :index i)
               (format t "~:r" i)))))

A template in a variable:

(defvar *x* '((:element :x x) "Test"))

((:root 'blah)
  (eval `(cl-fxml:with-xml
           (let ((x 123))
             ,*x*))))

Comment:

((:!-- "This is a comment."))

For lower case use the standard symbol character escaping (e.g. :|RootElement|):

((:|RootElement| '|Blah|)
  ((:|Test|)
    "Content"))

CDATA:

((:![CDATA[ "Raw data with symbols < >"))

Billion laughs attack:

((:?xml :version "1.0"))
((:!doctype 'lolz "["
  ((:!entity "lol0" (format nil "~s" "lol")))
  ((:!element 'lolz "(#PCDATA)"))
  (loop for i from 1 below 10
    do ((:!entity (format nil "lol~a" i)
                  (format nil "~s"
                          (apply #'concatenate 'string
                                 (loop repeat 10
                                   collect (format nil "&lol~a;" (1- i))))))))
  "]"))
((:lolz)
  "&lol9;")

TODO


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-fxml

Author

Goheeca <goheeca@gmail.com>

License

MIT

Description

cl-fxml: Common Lisp - Finally eXtended Markup Language.

Version

1.2.1

Dependencies
Source

cl-fxml.asd (file)

Component

cl-fxml.lisp (file)


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-fxml.asd

Location

cl-fxml.asd

Systems

cl-fxml (system)


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

3.1.2 cl-fxml/cl-fxml.lisp

Parent

cl-fxml (system)

Location

cl-fxml.lisp

Packages

cl-fxml

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 cl-fxml

Source

cl-fxml.lisp (file)

Use List
Exported Definitions
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


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

5.1.1 Special variables

Special Variable: *indent-size*
Package

cl-fxml

Source

cl-fxml.lisp (file)

Special Variable: *new-line-after-opening*
Package

cl-fxml

Source

cl-fxml.lisp (file)


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

5.1.2 Macros

Macro: with-xml &body BODY
Package

cl-fxml

Source

cl-fxml.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *extended-readtable*
Package

cl-fxml

Source

cl-fxml.lisp (file)

Special Variable: *indentation*
Package

cl-fxml

Source

cl-fxml.lisp (file)


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

5.2.2 Functions

Function: process-xml FORM WALKER
Package

cl-fxml

Source

cl-fxml.lisp (file)

Function: setup &optional RT
Package

cl-fxml

Source

cl-fxml.lisp (file)

Function: walk-xml FORMS ENV
Package

cl-fxml

Source

cl-fxml.lisp (file)

Function: xml-p FORM
Package

cl-fxml

Source

cl-fxml.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-fxml.asd: The cl-fxml․asd file
cl-fxml/cl-fxml.lisp: The cl-fxml/cl-fxml․lisp file

F
File, Lisp, cl-fxml.asd: The cl-fxml․asd file
File, Lisp, cl-fxml/cl-fxml.lisp: The cl-fxml/cl-fxml․lisp file

L
Lisp File, cl-fxml.asd: The cl-fxml․asd file
Lisp File, cl-fxml/cl-fxml.lisp: The cl-fxml/cl-fxml․lisp file

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   F   M   P   S   W   X  
Index Entry  Section

F
Function, process-xml: Internal functions
Function, setup: Internal functions
Function, walk-xml: Internal functions
Function, xml-p: Internal functions

M
Macro, with-xml: Exported macros

P
process-xml: Internal functions

S
setup: Internal functions

W
walk-xml: Internal functions
with-xml: Exported macros

X
xml-p: Internal functions

Jump to:   F   M   P   S   W   X  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*extended-readtable*: Internal special variables
*indent-size*: Exported special variables
*indentation*: Internal special variables
*new-line-after-opening*: Exported special variables

S
Special Variable, *extended-readtable*: Internal special variables
Special Variable, *indent-size*: Exported special variables
Special Variable, *indentation*: Internal special variables
Special Variable, *new-line-after-opening*: Exported special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-fxml: The cl-fxml system
cl-fxml: The cl-fxml package

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

S
System, cl-fxml: The cl-fxml system

Jump to:   C   P   S