Maybe we don't have the same release. Our version of 74 is generally stable, so we are waiting for the official release to upgrade.
Hi France,when running your query, I'm getting the following result (and no error):
<html xmlns="http://www.w3.org/1999/xhtml"> <head/> <body> <div> <div>A form...</div> <div/> </div> </body> </html>
It may be, however, that I've got the wrong contents in my en-us database? Do you have some helpful input?
Thanks,
Christian
On Mon, Nov 5, 2012 at 4:37 PM, France Baril <france.baril@architextus.com> wrote:
Setup:
- Empty DB feedback
- DB named 'en-us' with some content.
- The attached .xmq
- BaseX 7.4
- Tested on Safari and Chrome with similar results
TEST #1* Replace phone by a keyword available in your 'en-us' DB.You should get the following error:TEST #2If you make the function non-updating and replace line 36return (searchhlp:analyze-user-search-and-result(), db:output($html))
by line 35
return $html
You'll see that the same $html is a working HTML page.TEST #3.Back to the updating functionComment our line 35return $htmlGet line 36 backreturn (searchhlp:analyze-user-search-and-result(), db:output($html))You are back to the code from TEST #1, and should get the same error.
Now, on line #13, change let $result := <div>It works.
CONCLUSIONSending the HTML through db:output changes something in the way @xmlns is processed.On Fri, Nov 2, 2012 at 1:03 PM, Christian Grün <christian.gruen@gmail.com> wrote:
Hi France,
I tried a while to reproduce the issue you've been presenting, but I
didn't succeed so far. Do you think you could create a runnable
example for testing, or are there too many other components involved?
Thanks in advance,
Christian
___________________________
Christian Grün
Box 188, Uni KN
D-78457 Konstanz
http://christian-gruen.de
> Hi,
>
> My search function used to return $html correctly
>
> let $html := <html xmlns="http://www.w3.org/1999/xhtml">
> <head><link href="{$cssfile}" rel="stylesheet"
> type="text/css"/><title>Search help</title>
> <script type="text/javascript"
> xmlns="http://www.w3.org/1999/xhtml">{app:get-google-analytics-script()/text()}</script>
> </head>
> <body>
> <div> (…)
> <div>{$result-list}</div>
> </div></body></html>
> return $html
>
>
> I am now trying to keep records of users most popular queries in my DB, so I
> made the function an updating function and adapted the return value:
>
> let $html := <html xmlns="http://www.w3.org/1999/xhtml">
> <head><link href="{$cssfile}" rel="stylesheet"
> type="text/css"/><title>Search help</title>
> <script type="text/javascript"
> xmlns="http://www.w3.org/1999/xhtml">{app:get-google-analytics-script()/text()}</script>
> </head>
> <body>
> <div> (…)
> <div>{$result-list}</div>
> </div></body></html>
>
> return (feedback:analyze-user-search-and-result($keywords, $result-ids,
> $this-menu, $application, $carrier, $country, $lang, $model, $os),
> db:output($html))
>
>
> I got this error: error on line 30 at column 25: Attribute xmlns redefined
>
> After lots of research, I figured that when using db:output, the top element
> of $result-list is interpreted as coming from a different namespace. Adding
> xmlns="http://www.w3.org/1999/xhtml" to that top element resolved my issue,
> but I still don't get why this is happening, can you explain?
>
> More specifically, here are definitions of $result-lists and what they
> produce:
>
> let $result-list := <div/> would work when used in the 1st code sample, but
> not the second (updating function).
> let $result-list := <div xmlns:="http://www.w3.org/1999/xhtml"/> resolves
> the issue for the second (updating function).
>
> Thanks,
>
> France
>
> --
> France Baril
> Architecte documentaire / Documentation architect
> france.baril@architextus.com
> (514) 572-0341
>
> _______________________________________________
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
--
France Baril
Architecte documentaire / Documentation architect
france.baril@architextus.com
(514) 572-0341