Re: [xsl] xsl:import and use-when

Subject: Re: [xsl] xsl:import and use-when
From: "Rushforth, Peter peter.rushforth@xxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 May 2014 00:49:49 -0000
Hi,

From: Michael Kay mike@xxxxxxxxxxxx [xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx]
Sent: May 15, 2014 6:41 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] xsl:import and use-when


> The 2.0 spec says that in the dynamic context for evaluating use-when
expressions, the set of available documents is empty.

I did try to read that section of the 2.0 spec to see if there was a
static/dynamic issue that I might have overlooked.   I could not find what you
are referring to above.

I did find this [1]:

"Any element in the XSLT namespace may have a use-when attribute whose value
is an XPath expression that can be evaluated statically"

With regard to the doc() function, the 2.0 spec says that it should be stable
but that can be relaxed by implementations (relaxing seems reasonable in the
context of the web).  The doc-available() function is defined to return true
if doc() .would return a document node.

With regard to statically known available documents [2], the spec says that
statically known documents [3] in the static context [4] are used to provide
static type information, not to determine which documents are available.  But
if a document is statically known, it is potentially available using the doc()
function, hence I think the use of doc-available() in use-when should be
legal, although if it isn't it isn't.

Regards,
Peter

[1] http://www.w3.org/TR/xslt20/#conditional-inclusion
[2] http://www.w3.org/TR/xpath20/#dt-available-docs
[3] http://www.w3.org/TR/xpath20/#dt-known-docs
[4] http://www.w3.org/TR/xpath20/#dt-static-context

Current Thread