RE: [xsl] RE: doc-available vs. exists(document)

Subject: RE: [xsl] RE: doc-available vs. exists(document)
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 17 Jun 2009 13:35:52 +0100
> Now that I have my transformation working, I got to wondering why
> doc-available() and document() work a bit differently on their inputs.
> 
> If document() can find the file, why doesn't doc-available() 
> use the same rules?  I would think that I would check 
> document availability, then use the same value to actually 
> open the document.
> 
> There must have been a reason for the difference.  Is there 
> an (easy) explanation for this?

When the time came to design XQuery, it was felt that document() packaged
too much functionality into one function, and that it would be better to
split it into three logically separate and simpler operations: doc(),
base-uri(), and resolve-uri(). The doc-available() function was then
invented, and was aligned with doc() rather than document().

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

Current Thread