Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

**HOW DOES XQUERY WORK**

How does XQUERY work - does one need special software or a module to make it run - I found an example and tried to run it in IE 5.5 as an xml file but it doesn't run (error is: Only one top level element is allowed in an XML document. Line 12, Position 2)  
<bib>

- the example looked like this:


<?xml version="1.0"?>

<bib>
     <book year="1994">
          <title>TCP/IP Illustrated</title>
     </book>
     <book year="1992">
          <title>Advanced Programming in the Unix environment</title>
     </book>
</bib>

<bib>
 {
  for $b in document("http://www.bn.com/bib.xml")/bib/book
  where $b/publisher = "Addison-Wesley" and $b/@year > 1991
  return
    <book year="{ $b/@year }">
     { $b/title }
    </book>
 }
</bib>
0
dylanone
Asked:
dylanone
1 Solution
 
hdaneCommented:
The error arises becouse yoou have two top level elements <bib>. One for the XML, other for the query.
XQuery have to be executed on a XQuerz processor. Here is one to try http://www.cogneticsystems.com/xquery/xquery.html.
I don't think that IE 5.5 has one implemented.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now