From: Joe W. <jo...@gm...> - 2011-10-06 17:26:37
|
Slav, Could you confirm for the list which version of eXist you've seen the incorrect behavior on? Cheers, Joe 2011/10/6 Вячеслав Седов <sch...@gm...>: > hi, > > if (doc-available($file-name)) then doc($file-name) else > util:binary-doc($file-name) (: where $file-name point to xquery module > :) produce error like this > > Document /db/test/backup.xq is a binary resource, not an XML > document. Please consider using the function util:binary-doc() to > retrieve a reference to it. > > but here http://www.w3.org/TR/xpath-functions/#func-doc-available > > we can see > > "15.5.5 fn:doc-available > > fn:doc-available($uri as xs:string?) as xs:boolean > Summary: The function returns true if and only if the function call > fn:doc($uri) would return a document node. > > If $uri is an empty sequence, this function returns false. > > If a call on fn:doc($uri) would return a document node, this function > returns true. > > If $uri is not a valid URI according to the rules applied by the > implementation of fn:doc, an error is raised [err:FODC0005]. > > Otherwise, this function returns false. > > If this function returns true, then calling fn:doc($uri) within the > same ·execution scope· must return a document node. However, if > non-stable processing has been selected for the fn:doc function, this > guarantee is lost." > > with best wishes, > Slav |