[MarkLogic Dev General] Error XDMP-DUPATTR using lib-parser
Christopher Welch
Christopher.Welch at marklogic.com
Tue May 13 13:53:43 PDT 2008
A new version of lib-parser is available which includes the following significant changes:
Version 3.2-2008-05-06.1
ADD: Added support for shotgun-or queries.
CHG: Forward compatibility with 4.0-EA2
BUG: Fix of namespace issue.
http://developer.marklogic.com/code/
-----Original Message-----
From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Michael Blakeley
Sent: Friday, May 09, 2008 3:08 PM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] Error XDMP-DUPATTR using lib-parser
Mariano,
Thanks for reporting this problem. It's caused by a typo in
lib-parser.xqy, where the "weight" attribute was accidentally repeated.
Here's a patch:
@@ -592,8 +593,7 @@
lp:serialize-QNames(cts:element-word-query-element-name($t)),
cts:element-word-query-text($t),
for $o in cts:element-word-query-options($t)
- return element cts:option { $o },
- attribute weight { cts:element-word-query-weight($t) } }
+ return element cts:option { $o } }
case cts:word-query
return element cts:word-query {
attribute weight { cts:word-query-weight($t) },
Until this has been committed to the repository, you can apply this
patch to your own copy of lib-parser.xqy.
-- Mike
Mariano Grau Calín wrote:
> Hello,
>
>
>
> I put my field definition in $SEARCH-FIELD-MAP variable in lib-parser.xqy and run this code:
>
>
>
> ...
>
> let $query := lp:get-cts-query('pub:CADIZ gato')
>
> return $query
>
>
>
> I get
>
>
>
> <results warning="non-element node">cts:and-query((cts:element-word-query(xs:QName("DIARIO"), "CADIZ", ("lang=es"), 1), cts:word-query("gato", ("lang=es"), 1)), ())</results>
>
>
>
> Where i can see expanded my search-field-map
>
>
>
> However, my idea is to include this in lib-search search-criteria calling lp:serialize-cts-query but then get this error
>
>
>
> Code:
>
> let $query := lp:get-cts-query('pub:CADIZ gato')
>
> return lp:serialize-cts-query($query)
>
>
>
> Result:
>
> ERROR: eval-in Equis at file:c:/Xquerys/
>
> XDMP-DUPATTR: element cts:element-word-query { attribute weight { cts:element-word-query-weight($t) }, lp:serialize-QNames(cts:element-word-query-element-name($t)), cts:element-word-query-text($t), for $o as item()* in cts:element-word-query-options($t) return <cts:option>{ $o }</cts:option>, attribute weight { cts:element-word-query-weight($t) } } -- Two attributes with the same name
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
General at developer.marklogic.com
http://xqzone.com/mailman/listinfo/general
More information about the General
mailing list