Hi,
I can't seem to figure out how to bind an external variable as a document. I've searched all of the docs and am at a bit of loss. Is the following possible? possible?
I've tried the following: http://pastebin.com/sbekQZNP
With the following XQuery: http://pastebin.com/W8ZcMxJ9
But it always results in the error 'Invalid cast from xs:untypedAtomic to document-node()' - how does one tell it to be an document-node and not an xs:untypedAtomic. I've also tried setting it to doc('path/to/xml') with no luck
Thanks, Dustin
Hi Dustin,
it’s currently not possible to bind XPath/XQuery expressions to variables, or automatically evaluate document uris to document nodes. Instead, you’ll either have to..
– bind the XML contents to a variable and convert it to a document node in XQuery via fn:parse-xml, or – open the document via the -i command line flag or the OPEN command and directly access it in your query (or use "declare variable $doc := .;" to bind this document to the variable)
I’m sure there are some more options that I just don’t remember right now.
Cheers, Christian ___________________________
2013/6/5 Dustin Schultz dustin.schultz@utah.edu:
Hi,
I can't seem to figure out how to bind an external variable as a document. I've searched all of the docs and am at a bit of loss. Is the following possible? possible?
I've tried the following: http://pastebin.com/sbekQZNP
With the following XQuery: http://pastebin.com/W8ZcMxJ9
But it always results in the error 'Invalid cast from xs:untypedAtomic to document-node()' - how does one tell it to be an document-node and not an xs:untypedAtomic. I've also tried setting it to doc('path/to/xml') with no luck
Thanks, Dustin
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de