14 #:processing-instruction
31 #:with-excluded-namespaces
32 #:with-extension-namespaces
33 #:with-duplicates-check
))
35 (defpackage :xuriella-extensions
41 (:export
#:parse-stylesheet
46 #:parameter-local-name
52 #:define-extension-group
53 #:define-extension-parser
54 #:define-extension-compiler
61 (:import-from
:xpath-protocol
#:define-default-method
)
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}
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
82 @aboutfun{parse-stylesheet}
83 @aboutclass{stylesheet}
85 @begin[Profiling support]{section}
86 The profiling facility records the run time of XSLT templates.
88 @aboutfun{enable-profiling}
89 @aboutfun{disable-profiling}
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}
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,
124 @aboutfun{parse-body}
125 @aboutfun{compile-instruction}