XQUERY加载由XQIB处理的XML

时间:2010-03-05 08:46:51

标签: xml internet-explorer xquery

我们如何使用xquery加载xml文档,以便由IE浏览器中集成的XQIB处理器进行解析。 请注意,不支持将doc(“doc.xml”)与XQIB Processor一起使用。

2 个答案:

答案 0 :(得分:1)

我没有XQIB的经验,但我确实找到了这个:

http://www.systems.ethz.ch/education/courses/hs09/xml-and-databases/project/xqib-doc.pdf

Navigating other Web sources 
The doc function is not supported by XQIB. Instead, to query other sources from the 
Web, you should use the Zorba REST library (Zorba is the XQuery engine used by the 
plugin). This API is documented at 

http://www.zorba-xquery.com/doc/zorba-latest/zorba/html/rest.html 

For example: 

<html> 
  <head>    
    <script type="text/xquery"> 
      declare namespace zorba-rest 
        = "http://www.zorba-xquery.com/zorba/rest-functions"; 
      declare sequential function local:main() { 
        browser:alert( 
          (zorba-rest:get( 
              "http://www.inf.ethz.ch/rss/events.xml" 
             )//*:item/*:title/data(.) 
          )[1] 
        ) 
      }; 
    </script> 
  </head> 
  <body> 
    <h1>Hello world page.</h1> 
  </body> 
</html> 

Note that since XHTML is the default namespace, you need to use the joker (*) symbol 
to access elements which are in no namespace (it actually selects all possible 
namespaces). Unfortunately, there is no other known workaround about this in XQuery. 

答案 1 :(得分:0)

请注意:doc功能现已实施。