External variable of type document-node in GUI

Wednesday, 5 June 2013 · 2 messages · last reply 6 Jun 2013
DS
Dustin Schultz5 Jun 2013 20:25 #
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
CG
Christian Grün6 Jun 2013 01:10 #
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 at utah.edu>:
Quoted text · Dustin Schultz · 23 lines
> 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 at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >

⚡Generated with XQuery