A practical hands-on guide to processing XML documents in JDeveloper 11g. 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.
Author(s): Deepak Vohra
Publisher: Packt Publishing
Year: 2009
Language: English
Pages: 383
Table of Contents......Page 7
Preface......Page 13
Creating and Parsing an XML Document......Page 19
Setting the environment......Page 20
Generating an XML document......Page 22
Creating the factory......Page 23
Creating the DOM document object......Page 25
Creating the root element......Page 27
Constructing the DOM document......Page 28
Outputting the DOM document......Page 29
Running the Java application......Page 30
Parsing an XML document with the DOM API......Page 34
Creating a DOM document object......Page 35
Outputting the XML document components' values......Page 36
Running the Java application......Page 40
Parsing an XML document with the SAX API......Page 45
Parsing the XML document......Page 46
Running the Java application......Page 48
Summary......Page 55
Creating an XML Schema......Page 57
Root element......Page 59
Element component......Page 60
SimpleType component......Page 61
ComplexType component......Page 62
Setting the environment......Page 67
Creating an XML schema......Page 68
Registering an XML schema......Page 82
Creating an XML document from the XML schema......Page 84
Summary......Page 93
JDeveloper built-in schema validation......Page 95
Schema validation in XDK 11g......Page 98
Setting the environment......Page 99
Creating a schema validator......Page 104
Setting the error handler......Page 105
Running the Java application......Page 107
Schema validation with a SAX parser......Page 110
Creating a SAX parser......Page 111
Validating the XML document......Page 112
Running the Java application......Page 113
Setting the error handler......Page 116
Running the Java application......Page 117
Summary......Page 120
What is XPath?......Page 121
XPath support in Oracle XDK 11g......Page 123
Setting the environment......Page 124
XPath search......Page 125
Selecting nodes with absolute location paths......Page 127
Selecting nodes with relative location paths......Page 130
Selecting namespace nodes......Page 131
Creating the DOM parser......Page 133
Method selectSingleNode(String)......Page 134
Method selectSingleNode(String,NSResolver)......Page 135
Running the Java application......Page 137
Summary......Page 141
Transforming XML with XSLT......Page 143
Setting the environment for XSLT transformation......Page 144
Transforming an XML document......Page 147
Creating the TransformerFactory......Page 149
Creating the Transformer......Page 152
Running the application......Page 154
XSLT extension functions......Page 158
Setting the environment for XSLT extension functions......Page 159
Creating the stylesheet containing the extension functions......Page 160
Instantiating Java classes......Page 161
Storing Java results in XSLT—non-static method......Page 162
Modifying attributes......Page 163
Stylesheet with extension functions......Page 164
Processing the extension functions......Page 166
Summary......Page 168
Overview of the JSTL XML tag library......Page 169
Setting the environment......Page 173
Parsing with the JSTL XML tag library......Page 176
Transforming with the JSTL XML tag library......Page 185
Summary......Page 189
Loading and Saving XML with DOM 3.0 LS......Page 191
Background......Page 192
The API......Page 193
Setting the environment......Page 194
Loading an XML document......Page 195
Parsing the XML document......Page 196
Creating a document object......Page 201
Outputting the document object......Page 202
Filtering an XML document......Page 205
Filtering the input......Page 206
Filtering the output......Page 208
Summary......Page 212
Validating an XML Document with DOM 3 Validation......Page 213
Setting the environment......Page 214
Constructing and validating an XML document......Page 216
Global elements......Page 219
The catalog element......Page 221
Adding article attributes......Page 223
Adding article subelements......Page 224
Adding a journal element......Page 226
Validating a document......Page 227
Running the DOM 3 Validation application......Page 228
XDK 11g limitations......Page 237
Summary......Page 238
JAXB 2.0......Page 239
Setting the environment......Page 241
Compiling an XML schema......Page 244
Marshalling an XML document......Page 254
Unmarshalling an XML document......Page 259
Mapping Java to XML using annotations......Page 264
Summary......Page 270
Comparing XML Documents......Page 271
Setting the environment......Page 273
Comparing XML documents with the XMLDiff class......Page 274
Comparing the XML files......Page 276
Generating an XSLT stylesheet......Page 278
Running the Java application......Page 281
Summary......Page 284
Converting XML to PDF......Page 285
Setting the environment......Page 286
Converting XML to XSL-FO......Page 289
Generating the XSL-FO document......Page 292
Creating the FOP driver......Page 295
Running the Java application......Page 296
Summary......Page 301
Converting XML to MS Excel......Page 303
Setting the environment......Page 304
Creating a spreadsheet......Page 306
Parsing the XML document......Page 307
Outputting the spreadsheet......Page 308
Running the Java application......Page 309
Parsing the Excel spreadsheet......Page 313
Running the Java application......Page 314
Summary......Page 318
Storing XML in Oracle Berkeley DB XML......Page 319
Installing Oracle Berkeley DB XML......Page 320
Using the command shell......Page 322
Adding XML documents......Page 324
Querying XML documents with XQuery......Page 326
Modifying XML documents......Page 328
Replacing/deleting XML document nodes......Page 330
Using the Berkeley DB XML API in JDeveloper......Page 332
Setting the environment......Page 333
Adding XML documents......Page 335
Querying XML documents with XQuery......Page 336
Modifying XML documents......Page 337
Updating/renaming in XML documents......Page 339
Summary......Page 347
Oracle XML Publisher......Page 349
Setting the environment......Page 350
FO Processor Engine......Page 354
XSL-FO utility......Page 360
PDF document merger......Page 363
Data Engine......Page 367
Summary......Page 374
Index......Page 375