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
56 #:compile-instruction
)
57 (:import-from
:xpath-protocol
#:define-default-method
)
59 "Xuriella is an implementation of XSLT 1.0.
61 @begin[Using XSLT]{section}
62 XSLT stylesheets are invoked using the @code{apply-stylesheet} function,
63 which can parse, compile, and apply XSLT stylesheets.
65 Top-level parameters to the stylesheet can be specified using
66 parameter instances created by @fun{make-parameter}.
68 @aboutfun{apply-stylesheet}
69 @aboutclass{parameter}
70 @aboutfun{make-parameter}
72 @begin[Compiling stylesheets explicitly]{section}
73 @code{parse-stylesheet} allows the compilation of XSLT stylesheets into
74 objects ahead of time, so that @code{apply-stylesheet} only needs to
75 invoke the pre-compiled sheet rather than having to parse and
78 @aboutfun{parse-stylesheet}
79 @aboutclass{stylesheet}
81 @begin[Defining extension elements]{section}
82 Xuriella can be extended in two ways:
84 Custom XPath functions can be implemented using the extension
85 mechanism in @a[http://common-lisp.net/project/plexippus-xpath/atdoc/pages/xpath-sys.html]{Plexippus}.
87 Custom XSLT elements can be implemented using the following macros.
89 @code{define-extension-group} is used to establish a namespace for
90 the extensions, which can then be activated using a namespace declaration
91 and the @code{extension-element-prefixes} attribute in the stylesheet.
93 Every individual extension element needs at least a definition
94 using @code{define-extension-parser}. The parser will run at
95 compilation time and return an XSLT instruction in a sexp syntax.
96 If the extension can be implemented as a transformation into ordinary
97 XSLT elements, the parser only needs to return that XSLT sexp.
99 In addition, the sexp representation itself can be extended using
100 @code{define-extension-compiler}. The extension compiler will be
101 invoked while the stylesheet is compiled to return a function, usually
102 a closure, that will be called by the stylesheet at run-time.
104 @aboutmacro{define-extension-group}
105 @aboutmacro{define-extension-parser}
106 @aboutmacro{define-extension-compiler}
108 @begin[Functions useful in extensions]{section}
109 The following functions can be used by extension parsers and compilers,
110 to parse child nodes as instructions, or to compile such instructions,
113 @aboutfun{parse-body}
114 @aboutfun{compile-instruction}