[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: StreamBurner to preview Atom and RSS
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Mar 2026 13:06:59 -0000
On 06/03/2026 13:15, Schimon Jehudah sch@xxxxxxxxxxxx wrote:
> Is it valid or possible to allocate XPath directives as variables and
> apply the variables as XPath directives, similarly to "eval"?
>
> <xsl:variable name="feed-subtitle"
>                select="'atom:subtitle'"/>
>
> <xsl:variable name="entry-iterate"
>                select="'atom:entry'">
>
> Doing so, would significantly reduce the amount of repeated code.

In general, in XSLT 1.0 and 2.0 as standardized by the W3C, there is no
"eval" feature, only XSLT 3.0 has that with xsl:evaluate.

On the other hand, the most used XSLT 1.0 processor is probably libxslt
or xsltproc and depending on its configuration I think it has support
for EXSLT and its
https://exslt.github.io/dyn/functions/evaluate/index.html function.
There are also some other proprietary extension for "eval" in existing
XSLT 1.0 or 2.0 processors. Thus, if you want to use XSLT 1.0 and can
control which XSLT 1.0 processor you use, you can choose one with
support for EXSLT's evaluate or with support for a proprietary evaluate
function. If you expect your code to be portable and usable by any XSLT
1.0 processor I think you are out of options.

Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member