Gets name of collection

Thursday, 8 March 2012 · 2 messages · last reply 9 Mar 2012
AT
Anh Thuấn8 Mar 2012 09:59 #
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?
CG
Christian Grün9 Mar 2012 13:09 #
Dear Anh, the document-uri() / base-uri() functions may help you here. Christian
Quoted text · Anh Thuấn · 20 lines
On Thu, Mar 8, 2012 at 9:59 AM, Anh Thuấn <thuan.ly at 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 at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >

⚡Generated with XQuery