Let's say I have a database built from 40+ XML documents, each with about 4
million nodes for a total of about 404 million nodes, of which 30k are
high-level records of interest. Let's say that a given node of interest (a
PubMed record, actually) may occur once in this database for each time it
has been updated, and I can identify the most recent version of that record
by the PubMed ID and the filename (an ascending sort of the filenames sorts
them from least recent to most recent).
Is there a way in XQuery I can identify a record in this database not only
by its PubMed ID but also limit the result set by source document name? I
know that `db:path($elem)` gives me the document name for an element, but I
want to use the document name to help pick out the element from among
several that may share its PMID.
Context: I have 26 such databases, each of which contains 43-44 source
files, each of which contains 30000 records. I have built one index
database that, for each record, includes PubMed ID, source filename, and
database name. For a given PMID I can very quickly retrieve the db name and
the file name, but I need to search the db not only by PMID but also by
source filename in order to select the most recent version of a record.
Thank you & all the best,
Chuck Bearden