2016-04-11 8 views
0

Datei test.xqy gebunden:BaseX XQuery: REPO: kein Wertekontext

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> 

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

Ich glaube nicht, dass der Fehler über den Inhalt der 2 Dateien oben.

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

By the way, ich den gleichen Fehler, wenn ich versuche, neues Paket von der Kommandozeile zu installieren, verwirrte mir wirklich ... Ich glaube, ich genau 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. 

Antwort

0

Ihre Eingabe gefolgt REPO INSTALL [...] ist a Befehl, aber BaseX command-line interface erwartet XQuery, wenn Sie keine zusätzlichen Flags angeben. REPO wird daher als XPath-Ausdruck ./child::REPO interpretiert, für den der Kontextartikel . gebunden werden muss.

Versuchen Sie stattdessen:

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