开发者

XQUERY Load XML to be processed by XQIB

开发者 https://www.devze.com 2022-12-22 04:05 出处:网络
How can we load an xml document with开发者_如何学Python xquery to be parsed by the XQIB processor integrated in IE browser.

How can we load an xml document with开发者_如何学Python 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.


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. 


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

0

精彩评论

暂无评论...
验证码 换一张
取 消