Empty nodes, no text is shown in xquery sandbbox

View: New views
5 Messages — Rating Filter:   Alert me  

Empty nodes, no text is shown in xquery sandbbox

by masjab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I am trying to write a search query for a small app but it´s not working at all, because my eXist-xquery sandbox leads me to nowhere,,,=(

If I go to the online url and type into the xquery sandbox the example:

for $speech in //SPEECH
return $speech

everything works fine and the nodes from the xml including the text are shown.

When I do this on my local eXist installation, the node(tags) are shown, but the text in them is not.

I had this problem  a while ago and installes the eXist db again...but this can´t be the solution..


and maybe someone could help me with this:

my xml output from an Xform looks like this:
<searchData>
    <search>
        <searchName>lemma</searchName>
        <searchValue>PC</searchValue>
        <interpretAs/>
        <logicParameter/>
    </search>
    <search>
        <searchName>root</searchName>
        <searchValue>someRoot</searchValue>
        <interpretAs/>
        <logicParameter/>
    </search>
</searchData> 


I want to store the searchValue from the search, where the searchName = lemma...

in my search.xq 

let $sD := request:get-data() (looks like the searchData from above...)

for $tmp  in $sD/search[searchName &= 'lemma']
let $lemma := $sD/search/searchValue/text()


not working.=(...


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Empty nodes, no text is shown in xquery sandbbox

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

&= 'lemma' is a full text operator, im not sure that will work in the
context of a posted XML document.

What happens if you try = 'lemma' just to test?

2008/5/12 Masen J <masenjabban@...>:

> Hi all,
>
> I am trying to write a search query for a small app but it´s not working at
> all, because my eXist-xquery sandbox leads me to nowhere,,,=(
>
> If I go to the online url and type into the xquery sandbox the example:
>
> for $speech in //SPEECH
> return $speech
>
> everything works fine and the nodes from the xml including the text are
> shown.
>
> When I do this on my local eXist installation, the node(tags) are shown, but
> the text in them is not.
>
> I had this problem  a while ago and installes the eXist db again...but this
> can´t be the solution..
>
>
> and maybe someone could help me with this:
>
> my xml output from an Xform looks like this:
> <searchData>
>     <search>
>         <searchName>lemma</searchName>
>         <searchValue>PC</searchValue>
>         <interpretAs/>
>         <logicParameter/>
>     </search>
>     <search>
>         <searchName>root</searchName>
>         <searchValue>someRoot</searchValue>
>         <interpretAs/>
>         <logicParameter/>
>     </search>
> </searchData>
>
>
> I want to store the searchValue from the search, where the searchName =
> lemma...
>
> in my search.xq
>
>
> let $sD := request:get-data() (looks like the searchData from above...)
>
> for $tmp  in $sD/search[searchName &= 'lemma']
> let $lemma := $sD/search/searchValue/text()
>
>
> not working.=(...
>
>
> -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
>  Exist-open mailing list
>  Exist-open@...
>  https://lists.sourceforge.net/lists/listinfo/exist-open
>
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Parent Message unknown Re: Empty nodes, no text is shown in xquery sandbbox

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Are you sure $tmp is empty? and that it hasnt serialized the XML into the page?

2008/5/13 Masen J <masenjabban@...>:

> empty orbeon-page...
>
> I tried :
>
>
> xquery version "1.0";
> declare namespace exist = "http://exist.sourceforge.net/NS/exist";
> declare namespace xmldb = "http://exist-db.org/xquery/xmldb";
> declare namespace request="http://exist-db.org/xquery/request";
>
>
>
> let $sD := request:get-data()
> let $tmp  := $sD/search[searchName = 'lemma']
> let $lemma := $sD/search/searchValue/text()
>
> return
>
> <html>
> {$tmp}
> {$lemma}
> </html>
>
> The &tmp is empty.
> The &lemma holds the string(but concats boths to one string because there
> are two searchValues)...
>
> I want the one, where searchName ==lemma...
>
>
>
>
>
> Am 13.05.2008 um 10:14 schrieb Adam Retter:
>
>
> for $tmp  in $sD/search[searchName &= 'lemma']
> let $lemma := $sD/search/searchValue/text()
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Empty nodes, no text is shown in xquery sandbbox

by Dannes Wessels-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

On Tue, May 13, 2008 at 11:19 AM, Adam Retter <adam@...> wrote:
> Are you sure $tmp is empty? and that it hasnt serialized the XML into the page?

for $tmp  in $sD/search[searchName &= 'lemma']
let $lemma := $sD/search/searchValue/text()

what if you change this into

for $tmp  in $sD/search[searchName &= 'lemma']
let $lemma := $sD/searchValue/text()

regards

Dannes

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Parent Message unknown Re: Empty nodes, no text is shown in xquery sandbbox

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ah okay, hmm well I cant really imagine that this wouldnt work! I will
try and give it a test for you but wont be able to do anything until
maybe tomorrow night...


2008/5/13 Masen J <masenjabban@...>:

> I know I know...
>
>  I first manually wrote the xforms output into a test.xml file which the
> java admin tool works on..
>  Just to test, whether my query is wrong or not...
>
>
>  Am 13.05.2008 um 11:41 schrieb Adam Retter:
>
>
>
>
> > erm... I dont understadn how you could of done that.
> >
> > The Java Admin Tool has no notion of the HTTP Request as it is not
> > running in a HTTP context?!?
> >
> > 2008/5/13 Masen J <masenjabban@...>:
> >
> > > ah, I don´t know. How can I find out?
> > > I used the java admin tool(eXist) to test my query(sandbox is  not
> showing
> > > text...) and the following query does, what I want:
> > > (works on a searchData.xml file that has the same output as my xform...)
> > >
> > >
> > > let $sD := /searchData/search[searchName='lemma']
> > > let $lemma := $sD/searchValue/text()
> > > return $lemma
> > >
> > >
> > > but when I write this into my search.xq :
> > >
> > >
> > > let $sD := request:get-data()
> > > let $tmp  := $sD/search[searchName = 'lemma']
> > > let $lemma := $sD/search/searchValue/text()
> > > return
> > >
> > > <html>
> > > {$tmp}
> > > {$lemma}
> > > </html>
> > >
> > >
> > > the pages shows:
> > >
> > >
> > > <html>HERE ARE BOTH STRINGS FROM searchVALUE </html>
> > >
> > >
> > > So it seems as if it does ignore let $tmp  := $sD/search[searchName =
> > > 'lemma']
> > >
> > >
> > > what can I do?
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Am 13.05.2008 um 11:19 schrieb Adam Retter:
> > >
> > >
> > > Are you sure $tmp is empty? and that it hasnt serialized the XML into
> the
> > > page?
> > >
> > > 2008/5/13 Masen J <masenjabban@...>:
> > > empty orbeon-page...
> > >
> > > I tried :
> > >
> > >
> > > xquery version "1.0";
> > > declare namespace exist = "http://exist.sourceforge.net/NS/exist";
> > > declare namespace xmldb = "http://exist-db.org/xquery/xmldb";
> > > declare namespace request="http://exist-db.org/xquery/request";
> > >
> > >
> > >
> > > let $sD := request:get-data()
> > > let $tmp  := $sD/search[searchName = 'lemma']
> > > let $lemma := $sD/search/searchValue/text()
> > >
> > > return
> > >
> > > <html>
> > > {$tmp}
> > > {$lemma}
> > > </html>
> > >
> > > The &tmp is empty.
> > > The &lemma holds the string(but concats boths to one string because
> there
> > > are two searchValues)...
> > >
> > > I want the one, where searchName ==lemma...
> > >
> > >
> > >
> > >
> > >
> > > Am 13.05.2008 um 10:14 schrieb Adam Retter:
> > >
> > >
> > > for $tmp  in $sD/search[searchName &= 'lemma']
> > > let $lemma := $sD/search/searchValue/text()
> > >
> > >
> > >
> > >
> > > --
> > > Adam Retter
> > >
> > > eXist Developer
> > > { England }
> > > adam@...
> > > irc://irc.freenode.net/existdb
> > >
> > >
> > >
> >
> >
> >
> > --
> > Adam Retter
> >
> > eXist Developer
> > { England }
> > adam@...
> > irc://irc.freenode.net/existdb
> >
>
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open