External variables in GUI

Tuesday, 24 May 2011 · 4 messages
MR
Mike Rothon24 May 2011 13:33 #

Firstly I apologise if this has been asked before, but I cannot work out how to search this mailing list without downloading all the archives first.

I am working through the XQuery in 10 minutes tutorial and trying this XQuery:

declare variable $firstName as xs:string external;
<videos featuring="{$firstName}">
{
let $doc := doc('http://www.stylusstudio.com/examples/videos.xml')
    for $v in $doc//video,
       $a in $doc//actors/actor
    where ends-with($a, $firstName)
       and $v/actorRef = $a/@id
    order by $v/year
    return
<video year="{$v/year}">
          {$v/title}
</video>
}
</videos>

It's fine in standalone mode (command line), but I cannot find a way of supplying an external variable in the GUI.

Thanks and regards.

CG
Christian Grün24 May 2011 13:41 #

Dear Mike,

Quoted text · Mike Rothon · 2 lines
> Firstly I apologise if this has been asked before, but I cannot work out how > to search this mailing list without downloading all the archives first.

No problem; for further requests, feel free to try our mailing list search:

http://basex.org/service/mailinglist-search/

Quoted text · Mike Rothon · 2 lines
> It's fine in standalone mode (command line), but I cannot find a way of > supplying an external variable in the GUI.

You can either specify external variable bindings via the "set" command in the Command mode..

set bindings $firstName=x

..or add a default value to your XQuery expression (this feature is avaiable since XQuery 3.0):

  declare variable $firstName as xs:string external := 'x';
  $firstName

Hope this helps, Christian

MR
Mike Rothon24 May 2011 14:06 #

Hi Christian

Quoted text · Christian Grün · 5 lines
> No problem; for further requests, feel free to try our mailing list > search: > > http://basex.org/service/mailinglist-search/ >

Thanks! By the way, is it just me or is there a problem with the results formatting in Firefox 4? (seems fine in IE8)

Quoted text · Christian Grün · 12 lines
> You can either specify external variable bindings via the "set" > command in the Command mode.. > > set bindings $firstName=x > > ..or add a default value to your XQuery expression (this feature is > avaiable since XQuery 3.0): > > declare variable $firstName as xs:string external := 'x'; > $firstName > > Hope this helps,

Excellent both work perfectly! Many thanks.

CG
Christian Grün24 May 2011 15:10 #

Hi Mike (cc @ basex-talk),

you're right, Firefox seems to have problems rendering the page (Opera and Chrome didn't cause any problem in my ad-hoc test)..

Christian

Quoted text · Mike Rothon · 27 lines
> Hi Christian > > >> No problem; for further requests, feel free to try our mailing list >> search: >> >> http://basex.org/service/mailinglist-search/ >> > Thanks! By the way, is it just me or is there a problem with the results > formatting in Firefox 4? (seems fine in IE8) > > >> You can either specify external variable bindings via the "set" >> command in the Command mode.. >> >> set bindings $firstName=x >> >> ..or add a default value to your XQuery expression (this feature is >> avaiable since XQuery 3.0): >> >> declare variable $firstName as xs:string external := 'x'; >> $firstName >> >> Hope this helps, > > Excellent both work perfectly! Many thanks. >

⚡Generated with XQuery