Hello,
I want to query a BaseX XML Database via Python (BaseXClient.py). Therefore I write a XQuery script, which executes a FLOWR expression combined with a few self-written functions. A bunch of options, which are generated within my Python script, have to externally bind to this query.
For convenience it would be appropriate to have optional external variables which I do not have necessarily to bind, but which will have default values specified in the XQuery script. Is there a possibility to do this?
I thought about an alternative, that is to declare the options with the help of a XML snippet. But then I could not figure out how to bind this snippet as a node instead of a string, because XQuery itself does not have a function to convert a String containing a XML document to a node. Of course I could create before each request a new options document in the database, but this seems to be a bit unhandy.
All in all I have the impression, that those are quite easy problems, but for some reason I could not find any solution on the web, so I were glad about reading a solution to one of those problems.
All the best, Ronny