Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 序列与类型xs不匹配:字符串错误Xquery_Java_Xml_Database - Fatal编程技术网

Java 序列与类型xs不匹配:字符串错误Xquery

Java 序列与类型xs不匹配:字符串错误Xquery,java,xml,database,Java,Xml,Database,我使用BDBXML2.5.16在Java中存储和查询我的XML文档。这些文档是IMDB xml文档,包含从INEX网站获得的参与者信息。我存储在数据库中的一个文档如下 <?xml version="1.0" encoding="UTF-8"?> <persons> <person> <name>jason angeles </name> <filmography>

我使用BDBXML2.5.16在Java中存储和查询我的XML文档。这些文档是IMDB xml文档,包含从INEX网站获得的参与者信息。我存储在数据库中的一个文档如下

<?xml version="1.0" encoding="UTF-8"?>
 <persons>
  <person>
      <name>jason angeles
      </name>
      <filmography>
         <act>
            <movie>
               <title>prison planet 3 the revenge 1998
                </title>
              <year>1998
              </year>
             <character>evil ninja
              </character>
           </movie>
         </act>
      </filmography>
     </person>
     </persons>
当我执行查询时,我希望至少得到以下元素作为我的输出

                   Document : person_31000.xml:
                <filmography>
                       <act>
                             <movie>
                             <title>prison planet 3 the revenge 1998
                            </title>
                            <year>1998
                            </year>
                           <character>evil ninja
                           </character>
                          </movie>
                       </act>
                     </filmography>
文档:person_31000.xml:
监狱星球3 1998年的复仇
1998
邪恶忍者
但是,我没有使用上面的元素,而是得到了以下错误

    Exception in thread "main" com.sleepycat.dbxml.XmlException: Error:    
    Sequence does not match type xs:string? - the sequence contains more   
    than one item [err:XPTY0004], <query>:1:343, errcode =          
    QUERY_EVALUATION_ERROR at                                    
     com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_query__SWIG_0(Native 
    Method)  at 
     com.sleepycat.dbxml.XmlManager.query(XmlManager.java:544)
                             at   

      com.sleepycat.dbxml.XmlManager.query(XmlManager.java:320)
                             at   

      xmlirsystemstruxplus.XQueryEngine.queryEngine(XQueryEngine.java:269)
                             at 

         xmlirsystemstruxplus.XMLIRSystemStruXplus.main(XMLIRSystemStruXplus.java:109)
                             Java Result: 1
线程“main”com.sleepycat.dbxml.XmlException中的异常:错误: 序列与类型xs:string不匹配?-该序列包含更多信息 多个项目[err:XPTY0004],:1:343,errcode= 查询\u评估\u错误位于 com.sleepycat.dbxml.dbxml\u javaJNI.XmlManager\u query\u SWIG\u 0(本机) 方法)在 com.sleepycat.dbxml.XmlManager.query(XmlManager.java:544) 在 com.sleepycat.dbxml.XmlManager.query(XmlManager.java:320) 在 XQueryEngine.queryEngine(XQueryEngine.java:269) 在 xmlirsystruxplus.xmlirsystruxplus.main(xmlirsystruxplus.java:109) Java结果:1 请注意,我使用了contains-any-of()函数,因为contains()函数不适用于“planet Venture 1998”字符串,这可能是因为关键字在元素内容中的显示顺序不同

请任何人帮我查一下好吗 (1) 为什么我有上述错误?解决方案 (2) 为什么条件包含($entity/act/movie/title,“planet Venture 1998”)不起作用?如何使用contains()函数w.r.t this


提前谢谢你

看来你得到的回应是一种类型的从影记录,这确实不是一串。谢谢。我如何使我的查询返回d元素而不是字符串?您是否在某处指出结果将是xs:string类型的元素?检查您的配置文件。哪些配置文件?对不起,我是BDB xml数据库的新手
    Exception in thread "main" com.sleepycat.dbxml.XmlException: Error:    
    Sequence does not match type xs:string? - the sequence contains more   
    than one item [err:XPTY0004], <query>:1:343, errcode =          
    QUERY_EVALUATION_ERROR at                                    
     com.sleepycat.dbxml.dbxml_javaJNI.XmlManager_query__SWIG_0(Native 
    Method)  at 
     com.sleepycat.dbxml.XmlManager.query(XmlManager.java:544)
                             at   

      com.sleepycat.dbxml.XmlManager.query(XmlManager.java:320)
                             at   

      xmlirsystemstruxplus.XQueryEngine.queryEngine(XQueryEngine.java:269)
                             at 

         xmlirsystemstruxplus.XMLIRSystemStruXplus.main(XMLIRSystemStruXplus.java:109)
                             Java Result: 1