Saxon/XQuery strange thing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pablofaria
    New Member
    • Sep 2007
    • 2

    Saxon/XQuery strange thing

    I cant figure out what's wrong in the following code:
    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>
    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?
    Last edited by pbmods; Sep 15 '07, 01:24 AM. Reason: Added CODE tags.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Pablofaria. Welcome to TSDN!

    Please use CODE tags when posting source code:

    &#91;CODE]
    Source code goes here.
    &#91;/CODE]

    Comment

    Working...