Hi Christian,
I've created a new database with only the relevant part of each xml. It's much smaller and I hope it would help. The created xml is not a valid one since the xml and xml-model tags are missing, but it shouldn't be a problem. I've used map { 'stripns': true(), 'intparse': true() }) in db:add, but the namespaces were not removed, e.g. there is gml:beginPosition. Anyway, maybe because the xml are not valid, I get always 0 hits unless I ask to return the doc itself. Even with where db:node-id($ext)=0 or without conditions, but when I ask to return return $ext/sdn:SDN_DataIdentification instead of $ext (The xml doc).
With kind regards, Menashè
On 06/24/2015 01:58 PM, Christian Grün wrote:
I couldn't find an option in db:add to specificy an XPath. In my case, I need to extract only the elements under /gmd:MD_Metadata/gmd:identificationInfo/sdn:SDN_DataIdentification
We try to avoid XPath strings arguments whenever possible. Instead, simply use XQuery, which allows you to do all kinds of things.
Example 1 (add one document per element):
for $node at $pos in /gmd:MD_Metadata/..... return db:add('db', $pos || '.xml', $node)
Example 2 (add single document):
db:add('db', 'doc.xml', element xml { /gmd:MD_Metadata/..... })
Cheers, Christian