Hello. Is it possible to select documents in a database by a path pattern?
For example, there is a database storing following documents:
dir1/a.xml dir1/b.xml dir2/a.xml dir2/b.xml
I want to select documents named 'b.xml' only. I guess something like
db:open('dbname', '*/b.xml')/*
but it returns empty result. Thanks!
Dear Jacob,
Hello. Is it possible to select documents in a database by a path pattern?
You can use predicates instead. Examples:
db:open('dbname')[ends-with(db:path(.), '/b.xml')] db:open('dbname')[matches(db:path(.), '/b.xml$')]
Hope this helps, Christian
For example, there is a database storing following documents:
dir1/a.xml dir1/b.xml dir2/a.xml dir2/b.xml
I want to select documents named 'b.xml' only. I guess something like
db:open('dbname', '*/b.xml')/*
but it returns empty result. Thanks!
basex-talk@mailman.uni-konstanz.de