2016-04-11 16 views
0

dosya test.xqy bağlı hiçbir bağlam değeri: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> 

dosya Test.xsd: Ben hata 2'nin içeriği hakkında olduğunu düşünmüyorum

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

yukarıdaki dosyalar. Ben komut satırından yeni paket yüklemeye çalıştığınızda

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

, Bana gerçekten karıştı, aynı hata var ... Ben tam 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. 

cevap

0

Girişiniz REPO INSTALL [...] olduğunu ben takip düşünüyorum komutu, ancak BaseX command-line interface, ek bayraklar belirtmezseniz XQuery'yi bekler. REPO, bu nedenle . bağlam öğesine gereksinim duyan XPath ifadesi olan ./child::REPO olarak yorumlanır.

yerine bu deneyin:

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