Hi BaseX team, I 've met a problem of getting the name of the collection when retrievingXQuery. I am looking for a node satisfying a certain condition on multiple collections (each collection is a database of BaseX), when it returns a result, I want to know the name of that collection. For example, here is my query: for $node in (Collection("Database1"),Collection(Database2"))/a[@attribute = "name"] return $node // I want to get of the name of the collection of the returned node here. I don't know if BaseX supports a certain function to get the name of the collection from a node or something similar. Or does it has a way to know the node belongs to which collection?
Dear Anh, the document-uri() / base-uri() functions may help you here.
Christian ___________________________
On Thu, Mar 8, 2012 at 9:59 AM, Anh Thuấn thuan.ly@emotive.de wrote:
Hi BaseX team, I 've met a problem of getting the name of the collection when retrievingXQuery. I am looking for a node satisfying a certain condition on multiple collections (each collection is a database of BaseX), when it returns a result, I want to know the name of that collection. For example, here is my query: for $node in (Collection("Database1"),Collection(Database2"))/a[@attribute = "name"] return $node // I want to get of the name of the collection of the returned node here. I don't know if BaseX supports a certain function to get the name of the collection from a node or something similar. Or does it has a way to know the node belongs to which collection?
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de