16.10.2015 Views

Getting Started with DB2 Express-C

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 15 - <strong>DB2</strong> pureXML 267<br />

retrieval business processes<br />

Shred: 2 hrs<br />

Relative lines of I/O code 100 35 (65% reduction)<br />

Add field to schema 1 week 5 min.<br />

Queries 24 - 36 hrs 20 sec - 10 min<br />

Table 15.1 – Increased performance using pureXML technology<br />

15.3.2 XPath basics<br />

XPath is a language that can be used to query XML documents. Listing 15.1 shows an<br />

XML document, and Figure 15.7 illustrates the same document represented in parsedhierarchical<br />

(also called “node” or “leaf”) format. We will use the parsed-hierarchical format<br />

to explain how XPath works.<br />

<br />

<br />

John Doe<br />

408 555 1212<br />

344<br />

<br />

<br />

Peter Pan<br />

408 555 9918<br />

216<br />

<br />

<br />

Listing 15.1 – An XML document<br />

dept<br />

employee<br />

employee<br />

id=901<br />

name<br />

phone<br />

office<br />

id=902<br />

name<br />

phone<br />

office<br />

John Doe<br />

408-555-1212 344<br />

Peter Pan<br />

408-555-9918 216<br />

Figure 15.7 – Parsed-hierarchical representation of the XML document in Listing 15.1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!