I cant figure out what's wrong in the following code:
In the bolded line, if I change the "a_001.xml" by the "$fname/@filename" expression, it just doesnt work. But with the literal string it works. The problem with the "$fname/@filename" only happens on nested fors. In a simple one it works fine. I just dont get it. Any ideas?
Code:
let $corpuslocation := "/var/www/~tycho/corpus/texts/xml/"
for $fname in doc(concat($corpuslocation,'catalog.xml'))/catalog/corpusfile
return <option value="{$fname/@filename}">
{
let $fname2 := concat($corpuslocation,'a_001.xml') (: $fname/@filename) :)
let $titulo := doc($fname2)//meta[name="Document Title"]/val/text()
let $autor := doc($fname2)//meta[name="Document Author ID"]/val/text()
return concat($titulo," (",$autor,")")
}
</option>
Comment