I'm using Oxygen XML to to work with an XML file that contains references to other XML files. These other XML files are stored in a subdirectory of the directory that contains the main XML file.
Downloads/
directory1/
main.xml
subdirectory1/
other1.xml
other2.xml
The locations of the other XML files are stored as relative links within the main file. My query looks like something this:
for $df in /clldata/DiscussionForums/DiscussionForum
let $href := replace(data($df/@href),"\\","/")
for $p in doc($href)
return $p
The problem I've run into is that Oxygen uses the path to the xquery file as the base for the relative path, obviously resulting in file not found errors. How can I get the path to the XML document within my query?
Right now I'm just using concat() to prepend the correct path but I want this to be easily reusable.