Оба следующих запроса отлично работают на eXist-db, но вызывают следующие ошибки на сервере MarkLogic. Любая помощь приветствуется.
Запрос:
for $cust in //Customer[@id=1011]
for $ord in //Order[@Acct = $cust//Accounts//Account/@id/fn:string(.)]
return $ord/OrdQty/@Cash
return max($orderprice)
Ошибка:
[1.0-ml] XDMP-UNEXPECTED: (err: XPST0003) Неожиданная синтаксическая ошибка токена, неожиданный возврат_, ожидание $ end или SemiColon_ Stack Trace
В строке 10 столбец 0: В xdmp: eval ("xquery version 1.0-ml; declare namespace html = ...", (), 13899855847338100900different-tr ...) 8. 9. return $ ord / OrdQty / @ Cash 10 . return max ($ orderprice)
Запрос:
for $cust in //Customer
return <Customer>
{$cust/@id}
{$cust/Name}
<Customer_Securities>
{for $account in $cust/Accounts/Account
return <Account BALANCE="{$account/Balance/OnlineActualBal}"
ACCOUNT_ID="{$account/@id}">
<Securities>
{$account/Holdings/Position/Name}
</Securities>
</Account> }
</Customer_Securities>
</Customer>
Ошибка:
[1.0-ml] XDMP-EXPNTREECACHEFULL: для $ cust в fn: collection () / Потомок :: возврат клиента {$ cust / @ id} {$ cust / Name} {для $ account в $ cust / Accounts / Account return { $ account / Holdings / Position / Name}} - Кэш расширенного дерева заполнен на хосте gkomninos-pc.studentcom.co.uk Трассировка стека
В строке 3 столбец 0: В xdmp: eval ("версия xquery 1.0-ml; объявить пространство имен html = ...", (), 13899855847338100900different-tr ...) 1. Версия xquery "1.0-ml"; 2. объявить пространство имен html = "http://www.w3.org/1999/xhtml" ; 3. за $ cust in // Клиент 4. 5. возврат