8 Oct
2022
8 Oct
'22
1:44 a.m.
Dear BaseX people, what would be an efficient way of checking if a given node is a database node? According to the documentation, function db:name() throws an error if the node is not a database node. However, that is not what I observe.(The same applies to db:node-id(), db:node-pre(), db:path()). Therefore I resorted to this way of checking: try {db:name($node) ! db:exists(.)} catch * {false()} That is clumsy and unreliable: if applied to a node in a file, db:name() returns the base name of the file, which might accidentally be a database name. What would you recommend instead? Kind regards, Hans-Jürgen