14 #:processing-instruction
29 #:document
;fixme: incompatible with XSLT 2.0
34 #:with-excluded-namespaces
35 #:with-extension-namespaces
36 #:with-duplicates-check
))
38 (defpackage :xuriella-extensions
44 (:export
#:parse-stylesheet
48 #:define-extension-group
49 #:define-extension-parser
50 #:define-extension-compiler
52 #:compile-instruction
)
53 (:import-from
:xpath-protocol
#:define-default-method
)
55 "Xuriella is an implementation of XSLT 1.0.
57 @begin[Using XSLT]{section}
58 XSLT stylesheets are invoked using the @code{apply-stylesheet} function,
59 which can parse, compile, and apply XSLT stylesheets.
61 Top-level parameters to the stylesheet can be specified using
62 parameter instances created by @fun{make-parameter}.
64 @aboutfun{apply-stylesheet}
65 @aboutfun{make-parameter}
67 @begin[Compiling stylesheets explicitly]{section}
68 @code{parse-stylesheet} allows the compilation of XSLT stylesheets into
69 objects ahead of time, so that @code{apply-stylesheet} only needs to
70 invoke the pre-compiled sheet rather than having to parse and
73 @aboutfun{parse-stylesheet}
75 @begin[Defining extension elements]{section}
76 Xuriella can be extended in two ways:
78 Custom XPath functions can be implemented using the extension
79 mechanism in @a[http://common-lisp.net/project/plexippus-xpath/atdoc/pages/xpath-sys.html]{Plexippus}.
81 Custom XSLT elements can be implemented using the following macros.
83 @code{define-extension-group} is used to establish a namespace for
84 the extensions, which can then be activated using a namespace declaration
85 and the @code{extension-element-prefixes} attribute in the stylesheet.
87 Every individual extension element needs at least a definition
88 using @code{define-extension-parser}. The parser will run at
89 compilation time and return an XSLT instruction in a sexp syntax.
90 If the extension can be implemented as a transformation into ordinary
91 XSLT elements, the parser only needs to return that XSLT sexp.
93 In addition, the sexp representation itself can be extended using
94 @code{define-extension-compiler}. The extension compiler will be
95 invoked while the stylesheet is compiled to return a function, usually
96 a closure, that will be called by the stylesheet at run-time.
98 @aboutmacro{define-extension-group}
99 @aboutmacro{define-extension-parser}
100 @aboutmacro{define-extension-compiler}
102 @begin[Functions useful in extensions]{section}
103 The following functions can be used by extension parsers and compilers,
104 to parse child nodes as instructions, or to compile such instructions,
107 @aboutfun{parse-body}
108 @aboutfun{compile-instruction}