Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Processing XML documents with Oracle JDeveloper 11g

You're reading from   Processing XML documents with Oracle JDeveloper 11g

Arrow left icon
Product type Paperback
Published in May 2009
Publisher Packt
ISBN-13 9781847196668
Length 384 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (19) Chapters Close

Processing XML documents with Oracle JDeveloper 11g
Credits
About the Author
About the Reviewers
1. Preface
1. Creating and Parsing an XML Document FREE CHAPTER 2. Creating an XML Schema 3. XML Schema Validation 4. XPath 5. Transforming XML with XSLT 6. JSTL XML Tag Library 7. Loading and Saving XML with DOM 3.0 LS 8. Validating an XML Document with DOM 3 Validation 9. JAXB 2.0 10. Comparing XML Documents 11. Converting XML to PDF 12. Converting XML to MS Excel 13. Storing XML in Oracle Berkeley DB XML 14. Oracle XML Publisher

Preface

While a number of books on XML are available, none covers XML support in Oracle JDeveloper. Welcome to Processing XML documents with Oracle JDeveloper 11g, a book that will teach you about using Oracle XML technologies in Oracle JDeveloper. XML is the standard medium of data exchange. Examples of data exchange using XML are web feeds, which include RSS feeds and Atom feeds, and XML messages in web services. Java is the language most commonly used to process XML. Among the IDEs, Oracle JDeveloper has the most XML features. Some of the graphical XML features in JDeveloper are an XML editor to create an XML document, an XML schema editor to model an XML schema, and an XPath explorer to process XPath expressions. JDeveloper also provides built-in support for JAXB compilation. JDeveloper includes an integrated application server—the WebLogic Server—for running XML-based applications. Oracle XML Developer Kit (XDK) provides a set of components, tools, and utilities for developing XML-based applications. The XDK 11g libraries are included with Oracle JDeveloper 11g.

The objective of this book is to discuss XML development in Oracle JDeveloper. We shall use JDeveloper 11g, the latest version of JDeveloper. As developers commonly use an IDE for processing XML and developing XML applications, the book covers all aspects of XML development, which include:

  • Creating an XML document

  • Validating an XML document with an XML schema

  • Transforming an XML document

  • Addressing elements/attributes in an XML document using XPath

We shall use the Oracle XDK 11g for Java to develop XML applications. We shall also discuss Oracle XML Publisher and Oracle Berkeley DB XML. By the end of this book, you should know everything there is to know about XML and JDeveloper.

What this book covers

Chapter 1: We discuss creating an XML document using Oracle's XML Developer Kit (XDK) 11g in Oracle JDeveloper. We also discuss parsing an XML document using SAX and DOM Java APIs, which are also included in XDK 11g.

Chapter 2: We create an XML schema in the XML schema editor of Oracle JDeveloper. An XML schema represents the structure of an XML document. Subsequently, we instantiate an XML document from the XML schema.

Chapter 3: We discuss validating an XML document with an XML schema using the built-in feature to validate the schema and the XDK 11g schema validation APIs. We discuss three different APIs for schema validation: the XSDValidator, the SAX parser, and the DOM parser.

Chapter 4: We discuss XPath, which is used to address nodes in an XML document. We use XPath in the XPath Search GUI tool in Oracle JDeveloper 11g. We also use the XPath Java API in XDK 11g.

Chapter 5: We transform an XML document using the Transformation API for XML (TrAX), which is included in XDK 11g. We also discuss the XSLT extension functions.

Chapter 6: We parse and transform XML using the JSTL XML tag library in JDeveloper 11g.

Chapter 7: We load, save, and filter an XML document using the DOM 3.0 Load and Save APIs, which are provided in XDK 11g.

Chapter 8: We construct and validate an XML document using the DOM 3.0 Validation API, which is also included in XDK 11g.

Chapter 9: We discuss another built-in feature of JDeveloper 11g, the JAXB 2.0 compiler. We bind an XML schema to Java classes using the JAXB 2.0 compiler. Subsequently, we unmarshal an XML document and marshal an XML document using the compiled Java classes.

Chapter 10: We compare XML documents using the XMLDiff Java API included in XDK 11g.

Chapter 11: We convert an XML document to a PDF document using the Apache FOP Java API in JDeveloper.

Chapter 12: We create an MS Excel spreadsheet from an XML document in JDeveloper using the Apache POI Java API.

Chapter 13: We store an XML document in Oracle Berkeley DB XML, and subsequently query and update the XML document using both the Berkeley DB XML command shell and the Berkeley DB XML Java API. The Berkeley DB XML API is used in JDeveloper 11g.

Chapter 14: We create PDF reports in JDeveloper 11g using the Oracle XML Publisher Java API. We also merge PDF documents. We also create an XML report from a database table using the Data Engine API.

What you need for this book

The book is based on the Windows Install of Studio Edition of Oracle JDeveloper 11g. Therefore, you need to download and install JDeveloper 11g (jdevstudio11110install.exe) from http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html. The Windows Install requires Windows XP, 2003, or 2000. If you have Linux, the book may still be used (though it has not been tested with Linux) with slight modifications with the Linux Install. For example, the directory paths on Linux would be different than those of Windows used in the book. Other than Oracle JDeveloper 11g, you would need chapter-specific software. For example, for Chapter 11 you would need the Apache FOP binary distribution, for Chapter 12 you need to download the Apache POI HSSF API, for Chapter 13 you need to download Oracle Berkeley DB XML, and for Chapter 14 you need to download Oracle Database 10g or 11g and Oracle XML Publisher Enterprise 5.6.2.

Who is this book for?

The target audience of the book is XML application developers who want to learn about Oracle XML technologies and the XML features in Oracle JDeveloper 11g. Those who are already using Oracle XML technologies will learn about using the Oracle XML technologies in Oracle JDeveloper 11g. We won't be discussing the database-based XML technologies XSQL and XML SQL Utility, which were discussed in the book JDBC 4.0 and Oracle JDeveloper for J2EE Development (Packt Publishing). This book is suitable for professional XML developers. It is also suitable for an intermediate-level course in applied XML. The target audience is expected to have prior, albeit beginners', knowledge about XML such as: what an XML document is, what XSLT is, what XPath is, and what an XML schema is.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The XSDValidator class is used to validate an XML document that has been built into a DOM tree."

A block of code will be set as follows:

InputStream inputStream=new FileInputStream(new File("catalog.xsd"));
InputSource inputSource=new InputSource(inputStream);
XMLSchema schema = builder.build(inputSource);
xsdValidator.setSchema(schema);

Any command-line input and output is written as follows:

dbxml>createContainer catalog.dbxml

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "In the New Gallery window select Categories | General and Items | Generic Application."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to , making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code for the book

Visit http://www.packtpub.com/files/code/6668_Code.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide the location address or web site name immediately so we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.

Copyright credit

Some of the contents of this book were originally published by Oracle Technology Network. They are republished with the permission of Oracle.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime