build order fix
[xuriella.git] / package.lisp
blob85664830c742a5f15e91c0fe4ac3e714e0481263
1 (defpackage :xsl
2 (:nicknames :xslt)
3 (:use)
4 (:export #:template
5 #:apply-templates
6 #:apply-imports
7 #:call-template
8 #:element
9 #:literal-element
10 #:literal-attribute
11 #:attribute
12 #:text
13 #:unescaped-text
14 #:processing-instruction
15 #:comment
16 #:copy
17 #:value-of
18 #:unescaped-value-of
19 #:number
20 #:for-each
21 #:with-base-uri
22 #:copy-of
23 #:message
24 #:terminate
25 #:fallback
26 #:use-attribute-sets
28 ;; xuriella internals
29 #:with-version
30 #:with-namespaces
31 #:with-excluded-namespaces
32 #:with-extension-namespaces
33 #:with-duplicates-check))
35 (defpackage :xuriella-extensions
36 (:use)
37 (:export #:document))
39 (defpackage :xuriella
40 (:use :cl)
41 (:export #:parse-stylesheet
42 #:apply-stylesheet
43 #:stylesheet
44 #:parameter
45 #:parameter-uri
46 #:parameter-local-name
47 #:parameter-value
48 #:make-parameter
50 #:xslt-error
52 #:define-extension-group
53 #:define-extension-parser
54 #:define-extension-compiler
55 #:parse-body
56 #:compile-instruction
58 #:enable-profiling
59 #:disable-profiling
60 #:report)
61 (:import-from :xpath-protocol #:define-default-method)
62 (:documentation
63 "Xuriella is an implementation of XSLT 1.0.
65 @begin[Using XSLT]{section}
66 XSLT stylesheets are invoked using the @code{apply-stylesheet} function,
67 which can parse, compile, and apply XSLT stylesheets.
69 Top-level parameters to the stylesheet can be specified using
70 parameter instances created by @fun{make-parameter}.
72 @aboutfun{apply-stylesheet}
73 @aboutclass{parameter}
74 @aboutfun{make-parameter}
75 @end{section}
76 @begin[Compiling stylesheets explicitly]{section}
77 @code{parse-stylesheet} allows the compilation of XSLT stylesheets into
78 objects ahead of time, so that @code{apply-stylesheet} only needs to
79 invoke the pre-compiled sheet rather than having to parse and
80 compile it first.
82 @aboutfun{parse-stylesheet}
83 @aboutclass{stylesheet}
84 @end{section}
85 @begin[Profiling support]{section}
86 The profiling facility records the run time of XSLT templates.
88 @aboutfun{enable-profiling}
89 @aboutfun{disable-profiling}
90 @aboutfun{report}
91 @end{section}
92 @begin[Defining extension elements]{section}
93 Xuriella can be extended in two ways:
95 Custom XPath functions can be implemented using the extension
96 mechanism in @a[http://common-lisp.net/project/plexippus-xpath/atdoc/pages/xpath-sys.html]{Plexippus}.
98 Custom XSLT elements can be implemented using the following macros.
100 @code{define-extension-group} is used to establish a namespace for
101 the extensions, which can then be activated using a namespace declaration
102 and the @code{extension-element-prefixes} attribute in the stylesheet.
104 Every individual extension element needs at least a definition
105 using @code{define-extension-parser}. The parser will run at
106 compilation time and return an XSLT instruction in a sexp syntax.
107 If the extension can be implemented as a transformation into ordinary
108 XSLT elements, the parser only needs to return that XSLT sexp.
110 In addition, the sexp representation itself can be extended using
111 @code{define-extension-compiler}. The extension compiler will be
112 invoked while the stylesheet is compiled to return a function, usually
113 a closure, that will be called by the stylesheet at run-time.
115 @aboutmacro{define-extension-group}
116 @aboutmacro{define-extension-parser}
117 @aboutmacro{define-extension-compiler}
118 @end{section}
119 @begin[Functions useful in extensions]{section}
120 The following functions can be used by extension parsers and compilers,
121 to parse child nodes as instructions, or to compile such instructions,
122 respectively.
124 @aboutfun{parse-body}
125 @aboutfun{compile-instruction}
126 @end{section}"))