XQuery to know names of nonXML documents or if exist a file

Hi,
My doubt is because I can’t get a XQuery that result the names of all the documents in a folder /photos. These are my queries but they doesn’t work and I don’t know why.

/In this XQuery I try to return all docnames in the folder /photos but it doesnt work/
for $a input()/photos[@ino:docname]
return $a

/In this XQuery I try to return the tag if exist a docname with the same name as “logo.JPG”/
for $a input()/photos
where tf:containsText($a[@ino:docname], “logo.JPG”)
return

If someone could help me I will be grateful,
Regards,
Diego

Diego,

You can use the following XQuery to return all document names:

for $a in input()/photos
let $docname := tf:getDocname($x)
return {$docname}

Then if you want to compare a document name to a particular value then use can say:

for $a in input()/photos
let $docname := tf:getDocname($x)
where $docname = “logo.JPG”
return {$docname}

Hope this helps.