Listing 1: XQuery Example1

dbxml> query 'for $ent in (collection("xbench.dbxml")/dictionary/e)
where $ent/ss/s/qp/q/qd="1900"
return
$ent/hwg/hw'

28 objects returned for eager expression ' 
for $ent in (collection("xbench.dbxml")/dictionary/e)
where $ent/ss/s/qp/q/qd="1900"
return
$ent/hwg/hw'

Listing 2: XQuery Example1 Results

dbxml> print
<hw>husbandry</hw>
<hw>supper</hw>
<hw>strand</hw>
<hw>nominated</hw>
<hw>saying</hw>
<hw>coram</hw>
<hw>outwards</hw>
<hw>benches</hw>
<hw>faustuses</hw>
<hw>rhapsody</hw>
<hw>rotten</hw>
<hw>punish</hw>
<hw>favours</hw>
<hw>earth</hw>
<hw>italian</hw>
<hw>waits</hw>
<hw>mention</hw>
<hw>sea</hw>
<hw>compelled</hw>
<hw>rumination</hw>
<hw>outrage</hw>
<hw>liege</hw>
<hw>lifted</hw>
<hw>embrace</hw>
<hw>break</hw>
<hw>profession</hw>
<hw>erecting</hw>
<hw>cinna</hw>

Listing 3: XQuery Example2

dbxml> query 'for $a in (collection("xbench.dbxml")/dictionary/e)
where contains($a, "hockey")
return
$a/hwg/hw'

935 objects returned for eager expression '
for $a in (collection("xbench.dbxml")/dictionary/e)
where contains($a, "hockey")
return
$a/hwg/hw'

Listing 4: XQuery Example2 Results

dbxml> print
<hw>planks</hw>
<hw>gaul</hw>
<hw>minute</hw>
<hw>spot</hw>
<hw>slippery</hw>
<hw>adorns</hw>
<hw>homeward</hw>
<hw>serpents</hw>
<hw>gaunt</hw>
<hw>exclamations</hw>
<hw>disposer</hw>
<hw>walter</hw>
<hw>smilets</hw>
<hw>priamus</hw>
<hw>opinion</hw>
<hw>sebastian</hw>
<hw>sermons</hw>
<hw>metal</hw>
<hw>were</hw>
<hw>aching</hw>
<hw>summons</hw>
<hw>sap</hw>
...

Listing 5

dbxml> setVerbose 2 2

dbxml> query 'for $a in (collection("xbench.dbxml")/dictionary/e)
where contains($a, "hockey")
return
$a/hwg/hw'

Query      - Starting query execution
Query      - xbench.dbxml - U : [1] 2
Query      - Finished query execution, time taken = 48431.2ms

935 objects returned for eager expression
'for $a in (collection("xbench.dbxml")/dictionary/e)
where contains($a, "hockey")
return
$a/hwg/hw'

Listing 6: XPath Example1

dbxml> query 'collection("xbench.dbxml")/dictionary/e
[contains(. , "the hockey")]/hwg/hw'

436 objects returned for eager expression '
collection("xbench.dbxml")/dictionary/e[contains(. , "the hockey")]/hwg/hw'

Listing 7: XPath Example1 Results

dbxml> print
<hw>minute</hw>
<hw>slippery</hw>
<hw>adorns</hw>
<hw>homeward</hw>
<hw>serpents</hw>
<hw>gaunt</hw>
<hw>walter</hw>
<hw>smilets</hw>
<hw>sermons</hw>
<hw>metal</hw>
<hw>were</hw>
<hw>aching</hw>
<hw>summons</hw>
...

Listing 8

<?xml version="1.0" encoding="UTF-8"?>
<!-- generated by ToXgene Version 1.1a in Wed Jun 23 12:16:00 EDT 2004 -->
<dictionary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://www.cs.umb.edu/~smimarog/xmlsample/TCSD1.xsd">
	<e id="E1">
		<hwg>
			<hw>planks</hw>
			<pr>!gzkn+J|i@u</pr>
... 

Listing 9

<?xml version="1.0" encoding="UTF-8"?>
<!-- generated by ToXgene Version 1.1a in Wed Jun 23 12:16:00 EDT 2004 -->
<dictionary>
	<e id="E1">
		<hwg>
			<hw>planks</hw>
			<pr>!gzkn+J|i@u</pr>
...


dbxml> putDocument dict_10 C:\dictionary10.xml f
Document added, name = dict_10

Listing 10: Example

Find the q elements that have qd child element:
dbxml> query 'collection("xbench.dbxml")//q[qd]'
Query      - Starting query execution
Query      - xbench.dbxml - U : [1] 3
Query      - Finished query execution, time taken = 47303.4ms

41427 objects returned for eager expression 'collection("xbench.dbxml")//q[qd]'

dbxml> addIndex "" qd edge-element-presence-none
Adding index type: edge-element-presence-none to node: {}:qd

dbxml> query 'collection("xbench.dbxml")//q[qd]'
Query      - Starting query execution
Query      - xbench.dbxml - P(q.qd) : [1] 3
Query      - Finished query execution, time taken = 44062.3ms
41427 objects returned for eager expression 'collection("xbench.dbxml")//q[qd]'

Listing 11

dbxml> addIndex "" q edge-element-presence-none
Adding index type: edge-element-presence-none to node: {}:q

dbxml> query 'collection("xbench.dbxml")//q[qd]'
Query      - Starting query execution
Query      - xbench.dbxml - P(q.qd) : [1] 3
Query      - xbench.dbxml - P(q) : [41427] 3(0x04020213) 3(0x04020218) 3(0x0402021E)
3(0x04020222) 3(0x04020227) 3(0x0402022E) 3(0x04020233) 3(0x04020238) 3(0x0402023E)
3(0x04020243) ...
Query      - Finished query execution, time taken = 1766.52ms
41427 objects returned for eager expression 'collection("xbench.dbxml")//q[qd]'