当前位置:网站首页>图书 > 正文 >>

Processing XML documents with Oracle JDeveloper 11g

图书信息

作者Deepak Vohra
出版社Packt Publishing
ISBN9781847196675
出版时间2009-02-26
字数191.5万
分类进口书,外文原版书,电脑,网络

读书简介

This book is for newcomer and intermediate Java developers who want to work with XML documents using JDeveloper 11g. No previous knowledge of JDeveloper is assumed but the reader will need to be comfortable in XML and Java environments. Employing a comprehensive tutorial-based approach, this easy-to-follow book shows the reader various means of processing XML documents using the power of Oracle's JDeveloper 11g. In next to no time, the reader will be able to create, format, transform, compare, and schema validate XML documents with Oracle's IDE.

目录

Processing XML documents with Oracle JDeveloper 11g

Table of Contents

Processing XML documents with Oracle JDeveloper 11g

Credits

About the Author

About the Reviewers

Preface

What this book covers

What you need for this book

Who is this book for?

Conventions

Reader feedback

Customer support

Downloading the example code for the book

Errata

Piracy

Questions

Copyright credit

1. Creating and Parsing an XML Document

Setting the environment

Generating an XML document

Creating the factory

Creating the DOM document object

Creating the root element

Constructing the DOM document

Outputting the DOM document

Running the Java application

Parsing an XML document with the DOM API

Creating the factory

Creating a DOM document object

Outputting the XML document components' values

Running the Java application

Parsing an XML document with the SAX API

Creating the factory

Parsing the XML document

Running the Java application

Summary

2. Creating an XML Schema

An overview of XML Schema

Root element

Element component

SimpleType component

ComplexType component

Setting the environment

Creating an XML schema

Registering an XML schema

Creating an XML document from the XML schema

Summary

3. XML Schema Validation

JDeveloper built-in schema validation

Schema validation in XDK 11g

Setting the environment

Schema validation with XSDValidator

Creating a schema validator

Setting the error handler

Validating the XML document

Running the Java application

Schema validation with a SAX parser

Creating a SAX parser

Setting the error handler

Validating the XML document

Running the Java application

Schema validation with a DOM parser

Creating a DOM parser

Setting the error handler

Parsing the XML document

Running the Java application

Summary

4. XPath

What is XPath?

XPath support in Oracle XDK 11g

Setting the environment

XPath search

Selecting nodes with absolute location paths

Selecting nodes with relative location paths

Selecting namespace nodes

Selecting nodes with XPath API

Creating the DOM parser

Method selectSingleNode(String)

Method selectNodes(String)

Method selectSingleNode(String,NSResolver)

Method selectNodes(String,NSResolver)

Running the Java application

Summary

5. Transforming XML with XSLT

What we will cover in this chapter

Setting the environment for XSLT transformation

Transforming an XML document

Parsing the XML document

Creating the TransformerFactory

Creating the Transformer

Running the application

XSLT extension functions

Setting the environment for XSLT extension functions

Creating the stylesheet containing the extension functions

Instantiating Java classes

Parsing the XML

Storing Java results in XSLT—non-static method

Storing Java results in XSLT—static method

Modifying attributes

Modifying element text

Stylesheet with extension functions

Processing the extension functions

Summary

6. JSTL XML Tag Library

Overview of the JSTL XML tag library

Setting the environment

Parsing with the JSTL XML tag library

Transforming with the JSTL XML tag library

Summary

7. Loading and Saving XML with DOM 3.0 LS

Background

The API

Setting the environment

Loading an XML document

Creating the LSParser

Adding event handling

Parsing the XML document

Saving an XML document

Creating a document object

Creating an LSSerializer

Outputting the document object

Filtering an XML document

Filtering the input

Filtering the output

Summary

8. Validating an XML Document with DOM 3 Validation

Setting the environment

Constructing and validating an XML document

Parsing XML document and setting XML schema

Global elements

The catalog element

Adding journal attributes

Adding article attributes

Adding article subelements

Adding a journal element

Validating a document

Running the DOM 3 Validation application

XDK 11g limitations

Summary

9. JAXB 2.0

Setting the environment

Compiling an XML schema

Marshalling an XML document

Unmarshalling an XML document

Mapping Java to XML using annotations

Summary

10. Comparing XML Documents

Setting the environment

Comparing XML documents with the XMLDiff class

Parsing the XML files

Comparing the XML files

Generating an XSLT stylesheet

Running the Java application

Summary

11. Converting XML to PDF

Setting the environment

Converting XML to XSL-FO

Parsing the XML document

Generating the XSL-FO document

Converting XSL-FO to PDF

Creating the FOP driver

Generating the PDF document

Running the Java application

Summary

12. Converting XML to MS Excel

Setting the environment

Converting an XML document to an Excel spreadsheet

Creating a spreadsheet

Parsing the XML document

Adding XML data to the spreadsheet

Outputting the spreadsheet

Running the Java application

Converting an Excel spreadsheet to an XML document

Creating the XML document

Parsing the Excel spreadsheet

Constructing the XML DOM tree

Running the Java application

Summary

13. Storing XML in Oracle Berkeley DB XML

Installing Oracle Berkeley DB XML

Using the command shell

Adding XML documents

Querying XML documents with XQuery

Modifying XML documents

Replacing/deleting XML document nodes

Using the Berkeley DB XML API in JDeveloper

Setting the environment

Creating a container

Adding XML documents

Querying XML documents with XQuery

Modifying XML documents

Updating/renaming in XML documents

Summary

14. Oracle XML Publisher

Setting the environment

FO Processor Engine

XSL-FO Utility

PDF Document Merger

Data Engine

Summary

Index