2016-04-11 1 views
0

ファイルtest.xqyバインドされていないコンテキスト値:BaseXのXQuery:REPO:

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:私はエラーが2の内容についてではないと思います

<?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> 

上記のファイルところで

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

答えて

0

を踏襲だと思うあなたの入力REPO INSTALL [...]ですa コマンドですが、BaseX command-line interfaceでは追加のフラグを指定しないとXQueryが必要です。したがって、REPOは、XPath式./child::REPOと解釈され、コンテキスト項目.をバインドする必要があります。

代わりにこれを試してみてください:

basex -c"REPO INSTALL http://files.basex.org/modules/expath/functx-1.0.xar" 
関連する問題