RE: TR/xquery-operators/#func-doc

> 
> 15.4.4 fn:doc
> fn:doc($uri as xs:string?) as document? 
> 
> 
> No mention of the current 1.0 practice, fn:doc('')
> retrieving the current stylesheet.

The "current stylesheet" is an XSLT concept; the functions and operators
document needs to be generic as the the functions can be used in many
different processing environments. Nothing special is needed to make
fn:doc('') continue to work: '' is simply a relative URI, so this function
call retrieves the resource whose URI is the same as the base URI from the
static context, which in XSLT will be the current stylesheet module. 
> 
> I regret the change from document() to doc().
> An unnecessary change from an xslt perspective,
> requiring work which is not necessary
> when migrating from 1.0 to 2.0
> 
> What was the justification for the name change?
> 
The document() function is retained for use in XSLT. It was felt that for
environments other than XSLT, a simpler form of the function was needed, and
to retain backwards compatibility, a new name was therefore needed.

Michael Kay

Received on Monday, 12 May 2003 22:40:43 UTC