If you want to test in a conditional: if (doc($uri))
If you actually want a boolean value: exists(doc($uri)) Aaron > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:general- > [EMAIL PROTECTED] On Behalf Of Eric Palmitesta > Sent: Thursday, September 04, 2008 11:02 AM > To: ML Developer Mailing List > Subject: [MarkLogic Dev General] xml file existence > > Hi all, > > Is there a function to determine if an xml file exists within the ML > database? I thought it would be xdmp:uri-is-file, but as far as I can > tell this checks for the existence of a file on the application server > (not IN the database). I can't find a native function to check this, > currently I'm doing: > > define function util:uri-exists($uri as xs:string) > as xs:boolean > { > fn:exists(fn:doc($uri)) > } > > Is there a better way? > > Cheers, > > Eric > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
