BaseX XQuery:REPO:无上下文值绑定

BaseX XQuery:REPO:无上下文值绑定,xquery,basex,Xquery,Basex,文件test.xqy: let $last :="Proj" return <html> <head><title>Example</title></head> <body> <table frame="box"> <tr> <td>Name</td> <td>Last</td> <td>MRN</td> </tr>

文件test.xqy:

let $last :="Proj"
return
<html>
<head><title>Example</title></head>
<body>
<table frame="box">
<tr>
<td>Name</td>
<td>Last</td>
<td>MRN</td>
</tr>
{
for $person in ( doc("test.xsd")/data/person[last=$last] )
return
<tr>
<td>{$person/name/string()}</td>
<td>{$person/last/string()}</td>
<td>{$person/mrn/string()}</td>
</tr>
}
</table>
</body>
</html>
顺便说一下,当我试图从命令行安装新软件包时,我也遇到了同样的错误,真的让我很困惑。。。我想我完全遵循了


您的输入
REPO INSTALL[…]
是一个命令,但是如果您没有指定任何附加标志,则需要XQuery<因此,code>REPO被解释为XPath表达式
/child::REPO
,它需要绑定上下文项

请尝试以下方法:

basex -c"REPO INSTALL http://files.basex.org/modules/expath/functx-1.0.xar"
$ basex REPO LIST test.xqy
Stopped at /Users/jack/Workspace/xqy, 1/5:
[XPDY0002] REPO: no context value bound.
$ basex REPO LIST
Stopped at /Users/jack/Workspace/xqy, 1/5:
[XPDY0002] REPO: no context value bound.
$ basex REPO INSTALL http://files.basex.org/modules/expath/functx-1.0.xar
Stopped at /Users/jack/Workspace/xqy, 1/5:
[XPDY0002] REPO: no context value bound.
basex -c"REPO INSTALL http://files.basex.org/modules/expath/functx-1.0.xar"