Team Fly 

Page 289

Path-Based Access

As previously stated, path-based access to content stored within the Oracle XML DB repository is available from SQL. The function xdburitype() makes it possible to use a path-based metaphor to access content stored in the Oracle XML DB repository. Figure 8-4 shows the products sheet as stored in Oracle XML DB.

The following listing demonstrates the use of xdburitype() to access the document displayed in Figure 8-4, with its result set:

SQL> select xdburitype('/home/xteoma/xmldata/Products.xml')
  2   from dual;
XDBURITYPE('/HOME/XTEOMA/XMLDATA/PRODUCTS.XML')
---------------------------------------------------------------------
<?xml version=''1.0"?>
<Products>
 <ProdCategory category="Electronics">
  <product><name>Y Box</name></product>
  <product><name>Home Theatre Package with DVD-Audio/Video Play</name></product>
  <product><name>8.3 Minitower Speaker</name></product>
  <product><name>Smash up Boxing</name></product>
  <product><name>Martial Arts Champions</name></product>
  <product><name>Endurance Racing</name></product>
  <product><name>Bounce</name></product>

Image

FIGURE 8-4. Products.xml stored on Oracle XML DB

Team Fly 
0308