Hi,
I’ve cobbled together a query that I want to use to import xml from the filesystem into the database based on specific metadata requirements:
let $xmlroot := "/Users/jason.davis/Sandbox/dita-docs/content/"
for $file in file:list($xmlroot, true())
where matches($file, 'xml') or matches($file, 'ditamap')
let $doc := file:resolve-path($file, $xmlroot)
return if (doc($doc)//brand[contains(.,'xyz')])
then db:add("d4st^dita-docs^meta-test", $doc)
else ()
It works, so I’m pleased! I’m just wondering if there is a more efficient way to achieve what I want to do. I know that using a specific XPath in the doc function is one thing I can do better. Any suggestions
are appreciated!
Thanks,
Jason