xsl-list
[Top] [All Lists]

Re: [xsl] Confusion with generated xsl

2018-05-21 10:18:53

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
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>