Stefan Manegold wrote:
an then query this XML file using XQuery to load all document in a single collection:
for $doc in fn:doc("[abolute_path_to]docs.xml")/docs/doc return pf:add-doc($doc/@loc, $doc/@name, "MyCollection")
That should be it.
Hi Stefan, I've created the doc.xml file, which now has the unique filename of every xml file in it. However, I tried to use the XQuery sample you provided and got an error from MonetDB. I'm using the MAPI client in XQuery mode to enter the code from the post quoted above. The query spans over 2 lines and is terminated using Ctrl-D (It's a Red Hat Linux server). Here is the error: QUERY = for $doc in fn:doc("/mnt/da/monetdb/docs.xml")/docs/doc ERROR = !type error: no variant of function pf:add-doc accepts the given argument type(s): string?; string?; string !type error: maybe you meant: !type error: pf:add-doc (string, string) as docmgmt !type error: pf:add-doc (string, string, string) as docmgmt !type error: pf:add-doc (string, string, integer) as docmgmt !type error: pf:add-doc (string, string, string, integer) as docmgmt !type error: illegal arguments for function pf:add-doc I'm not intimately familiar with XQuery - is there some sort of type conversion that needs to be performed on the values extracted from the XML file? Regards, Phil -- View this message in context: http://www.nabble.com/-newbie--Loading-a-directory-of-XML-files-into-a-colle... Sent from the monetdb-users mailing list archive at Nabble.com.