Input Functions

XQuery uses input functions to identify the data to be queried. There are two input functions:

  1. doc() returns an entire document, identifying the document by a Universal Resource Identifier (URI). To be more precise, it returns the document node.

  2. collection() returns a collection , which is any sequence of nodes that is associated with a URI. This is often used to identify a database to be used in a query.

Table 1.1. Entity References Predefined in XQuery

Entity Reference

Character Represented

<

<

&gt;

>

&amp;

&

&quot;

"

&apos;

'

If our sample data is in a file named books.xml , then the following query returns the entire document:

 doc("books.xml") 

A dynamic error is raised if the doc() function is not able to locate the specified document or the collection() function is not able to locate the specified collection.



XQuery from the Experts(c) A Guide to the W3C XML Query Language
Beginning ASP.NET Databases Using VB.NET
ISBN: N/A
EAN: 2147483647
Year: 2005
Pages: 102

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net