Re: [xsl] Confusion with generated xsl

Subject: Re: [xsl] Confusion with generated xsl
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 May 2018 15:18:49 -0000
> Just one more question, is there any xsl or xpath construct that can't be
> generated using xslt?
>

That's a challenging one!

There are a few XML constructs that can't be generated using XSLT (for example
DTDs, entity references, arbitrary CDATA sections); the only construct in the
untyped XDM data model that can't be generated, as far as I'm aware, is an
unparsed entity. When it comes to typed nodes the situation is a bit more
complex, but that's not relevant here.

But although those constructs can appear in XSLT stylesheets they have no
semantic function when they do so, so I think it's fair to say you can
generate any XSLT stylesheet.

I'm assuming XSLT 2.0+ here. There are limitations in XSLT 1.0 concerning
namespaces: you have (in theory) no control over the processor's choice of
namespaces prefixes in XSLT 1.0, so you can't safely generate constructs like
select="system-property('xsl:version')", unless the processor generates the
prefixes you would instinctively expect, which of course most processors do.

XPath expressions are just character strings and you can certainly construct
any character string.

Michael Kay
Saxonica

Current Thread