Skip to Content
Mastering Oracle SQL, 2nd Edition
book

Mastering Oracle SQL, 2nd Edition

by Sanjay Mishra, Alan Beaulieu
June 2004
Beginner to intermediate
494 pages
13h 19m
English
O'Reilly Media, Inc.
Content preview from Mastering Oracle SQL, 2nd Edition

Chapter 16. XML

Extensible Markup Language (XML) has become the standard mechanism for sharing data between applications. This chapter will explore how XML documents may be stored in an Oracle database, how the data within an XML document can be extracted and stored in relational tables, and how an XML document can be constructed from data in relational tables.

What Is XML?

XML is a close cousin to HTML, but while HTML is primarily concerned with formatting and displaying data, XML is concerned with the data itself. Unlike HTML, with XML you may create your own tags, which is why XML is perfectly suited for describing data. The easiest way to understand XML is through an example, so here is an XML document that represents a customer purchase order:

<?xml version="1.0"?>
<purchase_order>
  <customer_name>Alpha Technologies</customer_name>
  <po_number>11257</po_number>
  <po_date>2004-01-20</po_date>
  <po_items>
    <item>
      <part_number>AI5-4557</part_number>
      <quantity>20</quantity>
    </item>
    <item>
      <part_number>EI-T5-001</part_number>
      <quantity>12</quantity>
    </item>
  </po_items>
</purchase_order>

The first line defines that the text that follows is an XML document that adheres to Version 1.0 of the XML specification. The second line is the root node of the document and has the tag <purchase_order>. A valid XML document must contain exactly one root node. Other nodes of the document can appear more than once as necessary to describe the data, as illustrated by the multiple <item> tags under the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Mastering Oracle SQL

Mastering Oracle SQL

Sanjay Mishra, Alan Beaulieu
Oracle SQL

Oracle SQL

Dan Hotka
Beginning Oracle SQL: for Oracle Database 12c, Third Edition

Beginning Oracle SQL: for Oracle Database 12c, Third Edition

Lex De Haan, Tim Gorman, Inger Jørgensen, Melanie Caffrey

Publisher Resources

ISBN: 0596006322Errata Page