XQUERY 加载要由 XQIB 处理的 XML

发布于 2024-08-24 03:35:29 字数 99 浏览 1 评论 0原文

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

How can we load an xml document with xquery to be parsed by the XQIB processor integrated in IE browser.
Notice that the doc("doc.xml") is not supported to use with XQIB Processor.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雾里花 2024-08-31 03:35:29

我没有使用 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. 

I have no experience with XQIB, but I did find this:

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. 
仄言 2024-08-31 03:35:29

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

Just a note: the doc function has now been implemented.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文