Hi Ronny
I use BaseX to do some transformatins over Pyton binding.

In case I test it in GUI, I have in my current collection one source document.
When I process it remtoely, I pass the data as string and convert it into xml document.

So in my XQuery code I have this:

         (:
          let $xml := collection()[1]
          :)
          let $xml := util:eval($xmlString)

The later is used in production and is converting incoming string into xml doc.

Jan



Jan Vlčinský
TamTam Research s.r.o.
Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic
tel: +420-597 602 024; mob: +420-608 979 040
skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com
http://cz.linkedin.com/in/vlcinsky



On 13 March 2012 17:08, Ronny Möbius <moebius@physik.hu-berlin.de> wrote:
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
_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk