Rahel Luethy writes:
>for one of the templates i use in the XSL, i'd like to read  the XPath
>pattern that's used in the "match"-attribute from the command line...
>just to give you an idea (i know that it doesn't work like this..):
>    <xsl:template match=$myXPathPattern>
[where $myXPathPattern was passed in from the command line]

First of all, this is the type of question that gets a better answer
in the XSL-list and the XSL FAQ. Your issue boils down to making the
match pattern be variable, and having the variable be evaluated as an
expression. In the former case, there are some very limited tricks
with predicates. If you need to have a wide-open range of possible
expressions, you should think about a two-stage transformation,
where the first stage produces the stylesheet for the second stage.
More generally, you may want to back away from details and think
about what you're trying to do overall.
.................David Marston

PS: Terminology purists would note that "patterns" aren't part of
XPath, only XSLT. XSLT patterns are derived from "expressions" in
XPath by imposing some restrictions.

Reply via email to