Package: xuriella

Macro define-extension-parser

Lambda List

define-extension-parser (ext name (node-var) &body body)


ext -- The name of an XSLT extension group (a symbol)
name -- Local name of the extension element (a string)
node-var -- Variable name for the node to be parsed, a symbol.
body -- Lisp forms, an implicit progn


Defines a parser an extension element. The parser function defined by this macro will be invoked when an XSLT extension element is encountered that has the namespace URI of the specified extension group and the local-name of this parser.

body should return an XSLT instruction in sexp syntax.

As a (very hypothetical) example, if the return value is computed using
 (xsl:text ,(princ-to-string node-var))  
the stylesheet will emit a text node at run time, with the string representation of the instruction node has a value.

Alternatively, a form can be returned that refers to user-specific compiler extensions:
     ,(stp:attribute-value node-var "frob-arg"))  
Use define-extension-compiler to implement an extension like frob.

See also