BaseX XQuery:REPO: 没有上下文值绑定

BaseX XQuery:REPO: no context value bound

文件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>

文件test.xsd:

<?xml version = "1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name = "people">
        <xs:complexType>

            <xs:sequence>


                <xs:element name = "person">
                    <xs:complexType>
                        <xs:sequence>

                            <xs:element name = "firstname" type = "xs:string" />
                            <xs:element name = "lastname" type = "xs:string" />
                            <xs:element name="test1">
                                <xs:simpleType>
                                   <xs:restriction base="xs:string">
                                    <xs:enumeration value="small" />
                                    <xs:enumeration value="medium" />
                                    <xs:enumeration value="large" />
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:element>



                    </xs:sequence>
                </xs:complexType>
            </xs:element>

        </xs:sequence>
    </xs:complexType>

</xs:element>

<xs:complexType name="A">
  <xs:attribute name="x" type="xs:NCName"/>
  <xs:attribute name="y" type="xs:QName"/>
 </xs:complexType>

 <xs:element name="SpecialOption">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="Option" type="xs:string" use="required"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

</xs:schema>

我认为错误不是关于上述 2 个文件的内容。

$ 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.

顺便说一下,当我尝试从命令行安装新包时出现了同样的错误,这让我很困惑......我想我完全按照 this

$ 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.

您的输入 REPO INSTALL [...] 命令 ,但如果您未指定任何其他标志,BaseX command-line interface 需要 XQuery。 REPO 因此被解释为 XPath 表达式 ./child::REPO,它需要绑定上下文项 .

试试这个:

basex -c"REPO INSTALL http://files.basex.org/modules/expath/functx-1.0.xar"