RE: [xsl] document() source

Subject: RE: [xsl] document() source
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 31 Oct 2005 12:08:24 -0000
> The question being, is the argument of document() an "other 
> XML strings
> meant to be used as URI references" If it is, you don't need to
> explictly escape the system SHOULD (ie it may, or may not, but on a
> good day, it might) do the esacping automatically.

I think the current status in the 2.0 specs (primarily fn:doc) is:

* it's permitted to supply an unescaped "URI" (a wannabe-URI) as the
argument

* it's context-dependent/implementation-dependent whether any given URI,
whether escaped or not, will find a document

* it's implementation-defined whether doc("a doc.xml") gives you the
identical document node as doc("a%20doc.xml"):  "If two calls to this
function supply different absolute URI References as arguments, the same
document node may be returned if the implementation can determine that the
two arguments refer to the same resource."

Not completely satisfactory, but things that depend on the URI specs rarely
are.

Saxon has recently changed so that the default URIResolver recognizes
unescaped "URI"s. However, it doesn't currently recognize the data: scheme.

Michael Kay
http://www.saxonica.com

Current Thread