Hi Graydon,
Thanks for sharing your use case.
However, so far as I can tell, full text only works directly on a database node. If I try to pass the node in a function, I get "No database node" errors from attempting full-text operations.
You can convert an XML node to the internal “database node” representation by applying a dummy operation:
let $xml := <xml>hello world</xml> update {} return ft:mark($xml[text() contains text 'hello'])
Does this already help? See the Wiki articles [1,2] for some revised information.
I have already asked myself in the past if we shouldn’t include a function that expose internal result positions to the user? Suggestions are welcome.
Best, Christian
[1] https://docs.basex.org/wiki/Full-Text_Module#ft:mark [2] https://docs.basex.org/wiki/Database_Module#Database_Nodes