By "static variable", I assume you mean that you want the
code for your extension instruction to look for this element at compile time? I
think you can actually do this. Your class that subclasses ExtensionInstruction
is actually an element node on the stylesheet tree, and you can navigate from
there to other nodes on the tree. As a matter of convention, I would avoid doing
this from the prepareAttributes() method, but it's perfectly OK to do it from
the validate() method. Also as a matter of good practice, try to avoid retaining
any references to nodes on the stylesheet tree at run-time: it's best to allow
it to be garbage-collected away once your instruction is compiled. Having said
that, it's your choice, the only harm that will come of it is that you use more
I want to take the attribute value passed into it and store it in a
static variable for use with the over xsl extension instructions I have
defined. I wanted to avoid passing these attributes (of which
there could be many) to the over xsl extension functions because then I would
need to pass them to every call I make to these functions in the
stylesheet. It is much cleaner and nicer to have them as independent
variables "floating" at the top of the stylesheet.
On 10/18/07, Michael
there's no way to influence the way such elements are handled (other that in
a filter applied to the stylesheet on its way into the system, of course).
You don't really explain what you want to do with such elements, you only
say that you don't want them to be ignored. Could you explain what you would
like to achieve?
Is there a way to write an XSLT extension non-instruction i.e.
an element that will not be ignored outside a template
like for "<lh:namespaces-to-pass-through
ns="http:\\www.LightHtmlExtractors.com/wc/ns1"/>" not to be skipped as
SF.net email is sponsored by: Splunk Inc.
Still grepping through log
files to find problems? Stop.
Now Search log events and
configuration files using AJAX and a browser.
Download your FREE copy of
Splunk now >> http://get.splunk.com/
saxon-help mailing list