Oracle Database 11g:
Building Oracle XML
DB Applications
Jinyu Wang
New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto
Copyright 2011 by The McGraw-Hill Companies, Inc. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. ISBN 978-0-07-175128-5
MHID 0-07-175128-9 The material in this eBook also appears in the print version of this title: ISBN 978-0-07-175129-2, MHID 0-07-175129-7. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark.
Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. To contact a representative please e-mail us at bulksales@mcgraw-hill.com. Oracle Database 11g: Building Oracle XMLDB Applications TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (McGraw-Hill) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms.
Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hills prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED AS IS. McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free.
Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise. To my friends in the Oracle XML DB and Oracle XDK team
About the Author
Jinyu Wang is a principal product manager in the Oracle Server Technology product management team. She has managed several Oracle products over the last 10 years in Oracle, including Oracle XDK, Oracle XML DB, Oracle Secure Enterprise Search (SES), and Oracle Text.
Jinyus current interests are in database, XML, and search. Jinyu frequently speaks at conferences, publishes papers in journals, and holds U.S. patents. She is a coauthor of Oracle Database 10g XML & SQL: Design, Build, & Manage XML Applications in Java, C, C++, & PL/SQL (McGraw-Hill/Oracle Press, 2004). About the Technical EditorsCoby D. Adams Jr. is a United States Navy veteran and 16-year IT professional specializing in Oracle Database Technologies.
He is certified as an Oracle Certified Professional, Microsoft Certified Database Administrator, and Microsoft Certified Systems Engineer. He worked as a network administrator and database administrator for five years before joining Oracle Corporation. As a member of Oracle Global Customer Support he has risen to the level of Senior Principal Support engineer and has held the responsibility of Global Technical Lead for XML Database for the last five years. Vikas Arora is director of the XML development team at Oracle Corporation, overseeing the development of XML Objects and Extensibility support in the Oracle database, as well as XML Development Kit (XDK) libraries for Java and C. Prior to his management role, Vikas worked as technical staff in the SQL Query, Data Dictionary, Objects, and Language interoperability areas. from University of California, Santa Barbara. Kongyi Zhou has been a senior developer in the Oracle XDK group for more than 10 years. Kongyi Zhou has been a senior developer in the Oracle XDK group for more than 10 years.
He is the lead developer in Java XML parser, DOM, XML Schema processor, and XST/XPath processors. His recent work is in streaming processing, Scalable DOM, and Binary XML. He also represents Oracle in the W3C XML Schema working group.
PART I
BASIC CONCEPTS AND TECHNOLOGIES PART II
MANAGING ORACLE XML DATABASEPART III
BUILDING XML APPLICATIONS
Acknowledgments
I appreciate my Oracle colleagues, customers, and partners. With their help and talent, I am able to enjoy exploring incredible technologies and solutions. I also thank my acquisitions team at McGraw-Hill, Stephanie Evans and Wendy Rinaldi, for making this book possible.
Many thanks to the technical reviewers: Coby Adams, Vikas Arora, and Kongyi Zhou. Many thanks to other reviewers and those who helped me with the technical problems, including Shijun Cheng, Susan Duncan, Geoff Lee, Tim Yu, Hui Zhang, Vadiraj Hosur, Mark Dake, Nipun Agarwal, Ravi Palakodet, Rohan Anguish, Sam Idicula, Thomas Baby, Timothy Chien, and Vinay Agarwal. Thanks for your patience in explaining the product features, and for the valuable discussions on the technology and products. Thanks to my managers, Vishu Krishnamurthy and Andrew Mendelsohn. Your support makes my journey at Oracle challenging but enjoyable.
Introduction
Since first published in 1998, XML has become one of the core Internet technologies.
XML now has spawned an entire family of standards that form the foundation of electronic publishing, information sharing, and application integrations. If you are an Oracle database developer, choosing to use XML can simplify your tasks and bring efficiency to data access and operations. XML and its processing are also flexible enough to allow you to complete tasks in different ways. However, XMLs strength is also its weakness: XMLs format and processing are infinitely flexible and extensible. Therefore, quite often, there are a myriad of ways that you can use XML technologies to achieve the same goal. You may have difficulty choosing the best approach.
Next page