Re: [xsl] Confusion with generated xsl

Subject: Re: [xsl] Confusion with generated xsl
From: "ian.proudfoot@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 26 May 2018 12:26:58 -0000
Thank you Michael,

It was helpful to get the reassurance that I wasn't trying to do the
impossible! My XSL generation now works as required, but I have to say that
it does stretch the mind to develop an efficient xsl generating stylesheet!

Regards
Ian

-----Original Message-----
From: Michael Kay mike@xxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> 
Sent: 21 May 2018 16:19
To: xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [xsl] Confusion with generated xsl


> 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