File: context.html

package info (click to toggle)
libdb-ruby 0.6.5-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,596 kB
  • ctags: 3,978
  • sloc: ansic: 13,984; cpp: 8,739; ruby: 7,864; sh: 47; makefile: 6
file content (82 lines) | stat: -rw-r--r-- 4,266 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0" ?>
<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>docs/context.rd</title>
</head>
<body>
<h2><a name="label-0" id="label-0">BDB::XML::Context</a></h2><!-- RDLabel: "BDB::XML::Context" -->
<p>The Context class encapsulates the context within which a query
is performed against an Container. The context includes namespace 
mappings, variable bindings, and flags that indicate how the query result 
set should be determined and returned to the caller. Multiple queries can 
be executed within the same Context;</p>
<p>Context allows you to define whether queries executed within the
context are to be evaluated lazily or eagerly, and whether the query
is to return live or dead values.</p>
<p>The Query syntax permits expressions to refer to namespace prefixes,
but not to define them. The Context class provides namespace
management methods so that the caller may manage the namespace prefix to
URI mapping. By default the prefix "dbxml" is defined to be
"http://www.sleepycat.com/2002/dbxml". </p>
<p>The Query syntax also permits expressions to refer to externally
defined variables. The XmlQueryContext class provides methods that
allow the caller to manage the externally-declared variable to value
bindings. </p>
<h3><a name="label-1" id="label-1">Methods</a></h3><!-- RDLabel: "Methods" -->
<dl>
<dt><a name="label-2" id="label-2"><code>self[variable]</code></a></dt><!-- RDLabel: "self[variable]" -->
<dd>
Get the value bound to a variable</dd>
<dt><a name="label-3" id="label-3"><code>self[variable] = <var>value</var></code></a></dt><!-- RDLabel: "self[variable] = value" -->
<dd>
Bind a value to a variable</dd>
<dt><a name="label-4" id="label-4"><code>clear_namespaces</code></a></dt><!-- RDLabel: "clear_namespaces" -->
<dd>
Delete all the namespace prefix mappings</dd>
<dt><a name="label-5" id="label-5"><code>collection</code></a></dt><!-- RDLabel: "collection" -->
<dd>
Discover the name of the default collection used by fn:collection()
with no arguments in an XQuery expression.</dd>
<dt><a name="label-6" id="label-6"><code>collection = <var>uri</var></code></a></dt><!-- RDLabel: "collection = uri" -->
<dd>
<p>Set theURI specifying the name of the collection. </p>
<p>The default collection is that which is used by fn:collection()
without any arguments in an XQuery expression.</p></dd>
<dt><a name="label-7" id="label-7"><code>del_namespace(<var>name</var>)</code></a></dt><!-- RDLabel: "del_namespace" -->
<dd>
Delete the namespace URI for a particular prefix</dd>
<dt><a name="label-8" id="label-8"><code>evaltype</code></a></dt><!-- RDLabel: "evaltype" -->
<dd>
Return the evaluation type</dd>
<dt><a name="label-9" id="label-9"><code>evaltype = <var>type</var></code></a></dt><!-- RDLabel: "evaltype = type" -->
<dd>
Set the evaluation type</dd>
<dt><a name="label-10" id="label-10"><code>get_namespace(<var>name</var>)</code></a></dt><!-- RDLabel: "get_namespace" -->
<dd>
Get the namespace URI that a namespace prefix maps onto</dd>
<dt><a name="label-11" id="label-11"><code>get_results(<var>name</var>)</code></a></dt><!-- RDLabel: "get_results" -->
<dd>
Same than Context#[] but return the sequence of values bound to the variable.</dd>
<dt><a name="label-12" id="label-12"><code>returntype</code></a></dt><!-- RDLabel: "returntype" -->
<dd>
Return the return type</dd>
<dt><a name="label-13" id="label-13"><code>returntype = <var>type</var></code></a></dt><!-- RDLabel: "returntype = type" -->
<dd>
Set the return type</dd>
<dt><a name="label-14" id="label-14"><code>set_namespace(<var>name</var>, <var>uri</var>)</code></a></dt><!-- RDLabel: "set_namespace" -->
<dd>
<p>Define a namespace prefix, providing the URI that it maps onto</p>
<p>If <var>uri</var> is <var>nil</var> delete the namespace</p></dd>
<dt><a name="label-15" id="label-15"><code>uri</code></a></dt><!-- RDLabel: "uri" -->
<dd>
Returns the base URI used for relative paths in query expressions.</dd>
<dt><a name="label-16" id="label-16"><code>uri = <var>val</var></code></a></dt><!-- RDLabel: "uri = val" -->
<dd>
Sets the base URI used for relative paths in query expressions.</dd>
</dl>

</body>
</html>