【问题标题】:xquery - expected return found letxquery - 找到预期的回报让
【发布时间】:2011-05-10 06:36:37
【问题描述】:

我从撒克逊人那里得到了这个错误,

引擎名称:Saxon-PE XQuery 9.2.1.2 严重性:致命 说明:#... (:return :) 中的 XQuery 语法错误 let $#: 预期的“return”,找到的“let” 开始位置:776:0

关于这个功能

declare function local:set-internet-type($req1 as element(ns0:req), $cate as element()) as xs:string {
  if(count(   for $itm in $req/*:cust/*:inter/*:itm
      where $789/*:product/*:030/*:specs/*:name/text()= data($11/INTERNET)
      and $22/*:action/text()="CHANGE"
      return $33)>0) then
  (
  for $44 in $55
      where $tt/*:name/text()= data($t/INTERNET)
   and $u/*:action/text()="CHANGE"
   (:return <fake/>:)

    let $z:= $a/*:product/*:c/*:e[1]

        return concat($x,'>',$y)
  ) else ("")
};

我是 xquery 的新手,我在这个错误上花了很多时间却没有找到解决方案。 Vars 被有意屏蔽了,但从错误消息来看似乎与函数流有关。

感谢任何帮助。

提前致谢 亚历山德罗

【问题讨论】:

    标签: xquery


    【解决方案1】:

    Saxon 只声明“部分支持 XQuery 1.1”。因此,我猜它支持旧的 FLWOR 格式,在这种格式中,您不能在 where 之后使用 let。试着交换这些子句:

    for $44 in $55
    let $z:= $a/*:product/*:c/*:e[1]
    where $tt/*:name/text()= data($t/INTERNET)
       and $u/*:action/text()="CHANGE"
    return concat($x,'>',$y)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-10
      • 1970-01-01
      • 2018-10-04
      • 1970-01-01
      • 2022-01-23
      相关资源
      最近更新 更多