Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Processing XML documents with Oracle JDeveloper 11g
Processing XML documents with Oracle JDeveloper 11g

Processing XML documents with Oracle JDeveloper 11g:

eBook
zł39.99 zł196.99
Paperback
zł246.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Processing XML documents with Oracle JDeveloper 11g

Chapter 2. Creating an XML Schema

While XML has become the standard medium for exchanging data, it's the XML schema that defines the structure, content, and semantics of the XML documents. Before you create an XML document that conforms to an XML schema, create the XML schema with the procedure explained in this chapter. Why is it better to start off from an XML schema instead of directly creating the XML document without a schema? Consider a shipping company that sends XML documents containing details on a cargo shipment to a client. If the XML documents are not based on an XML schema, the shipping company might send XML documents containing different sets of elements and attributes. The client won't be able to interpret the XML documents if the XML documents contain different sets of elements and attributes. If the XML documents are based on an XML schema, the client would receive similar XML documents and be able to interpret them. An XML schema makes XML documents understandable to the...

An overview of XML Schema


The structure of an XML document is represented by an XML schema. An XML schema is also an XML document in the namespace http://www.w3.org/2001/XMLSchema.

Root element

The root element in a schema is schema. The schema namespace is specified in the root element with the declaration xmlns:xs=http://www.w3.org/2001/XMLSchema. A prefix other than xs may be used, such as xsd. A schema element may have attributes targetNamespace, version, attributeFormDefault, and elementFormDefault.

  • targetNamespace specifies the namespace described in the schema. "An XML namespace is a collection of names, identified by a URI reference, which are used in XML documents as element types and attribute names." (http://www.w3.org/TR/1999/REC-xml-names-19990114/)

  • elementFormDefault and attributeFormDefault specify whether elements and attributes in the targetNamespace are required to be qualified by default.

A qualified name consists of a prefix that is mapped to a namespace URI followed...

Setting the environment


Create an application and a project in JDeveloper by selecting File|New, and subsequently selecting Categories|General and Items|Generic Application in the New Gallery window. In the Create Generic Application window specify the Application Name, XMLSchema for example, and click on Next. In the Name your Generic project window specify a Project Name, XMLSchema for example, and click on Finish.

Creating an XML schema


In this section we shall create an XML schema, catalog.xsd (as listed in the introduction), in JDeveloper Schema Visual Editor. First, add a schema file to project XMLSchema. Select the XMLSchema node in Application Navigator and select File|New. In the New Gallery window select General|XML in Categories, and XML schema in Items. Click on the OK button.

In the Create XML schema window specify a File Name, catalog.xsd, and click on OK. An XML schema gets added to project XMLSchema. In the Design view, the different components of the schema are displayed in the schema visual editor. In the Source view, the schema document source is listed. The different schema components available to add to a schema are listed in the Schema Components Component Palette.

Components may be added to an XML schema either from the Component Palette or a component node in the schema. As an example of adding a component from a component node, add root element catalog. Right-click on<schema...

Registering an XML schema


In this section we shall register an XML schema in JDeveloper for XML editing. A registered schema may be used to create an instance of an XML document that conforms to the schema. To register a schema, select Tools|Preferences. In the Preferences window select XML schemas. In the XML schemas frame, click the Add button to register a schema.

In the Add Schema window, click the Browse button to select a schema. In the Open window, select catalog.xsd (which was created in the previous section). The catalog.xsd schema gets added to the Add Schema window. Extension specifies the extension of the file type from which the registered schema may be used to create an XML document instance. We have specified Extension as .xml, which implies that the registered schema may be used to create .xml documents. If you were registering an XML schema to create XSLT files, you would specify Extension as .xslt.

The XML schema catalog.xsd gets added to User Schemas for XML Editing...

Creating an XML document from the XML schema


In this section we shall create an XML document instance, catalog.xml (which was listed in the introduction), from the registered schema catalog.xsd. We're using a registered schema, but it is not essential as it's also possible to create an XML document instance using an XML schema in the file system.

However, using a registered XML schema does have an advantage. You may associate it with a specific file extension. For example, to register an XML schema for generating only .xslt files you would associate the .xslt extension with the XML schema.

Select project node XMLSchema in Application Navigator, and select File|New. In the New Gallery window select Categories|General|XML. Select XML Document from XML schema in the Items listed. Click on the OK button.

The Create XML Document from XML schema wizard gets started. Click on the Next button.

In the File Location window specify the XML File name as catalog.xml. Select Use Registered Schemas to...

Summary


In this chapter we introduced the commonly used XML schema structures. We created an XML schema in Oracle JDeveloper Schema Visual Editor. We discussed the various methods by which XML schema components may be added to an XML schema. Subsequently, we registered the XML schema in JDeveloper. Registering a schema associates the schema with a specific file extension. We created an XML document that conformed to the XML schema. In the next chapter we shall validate an XML document with an XML schema.

Left arrow icon Right arrow icon

Key benefits

  • Will get the reader developing applications for processing XML in JDeveloper 11g quickly and easily
  • Self-contained chapters provide thorough, comprehensive instructions on how to use JDeveloper to create, validate, parse, transform, and compare XML documents.
  • The only title to cover XML processing in Oracle JDeveloper 11g, this book includes information on the Oracle XDK 11g APIs.
  • Packed with example code and detailed commentary, the book is fully illustrated with functional step-by-step examples.

Description

XML is an open standard for creating markup languages and exchanging structured documents and data over the Internet. JDeveloper 11g presents an effective, quick, and easy-to-use means of processing XML documents. Inspired by the author's previous XML articles for the Oracle community, this expanded hands-on tutorial guides newcomers and intermediate users through JDeveloper 11g and XML document development. It offers up-to-date information on working with the latest version of JDeveloper, and brand new information on JAXB 2.0 support in JDeveloper 11g. Filled with illustrations, explanatory tables, and comprehensive instructions, this book walks the reader through the wide assortment of JDeveloper's capabilities. Oracle's JDeveloper 11g is an Integrated Development Environment that provides a visual and declarative approach to application development. Over the course of 14 chapters, readers will get hands-on with JDeveloper as the comprehensive and self-contained tutorials provide clear instruction on the key XML tasks that JDeveloper can accomplish. Filled with practical information and illustrated examples, this book shows the reader how to create, parse, and store XML documents quickly, as well as providing step-by-step instructions on how to construct an XML schema and use the schema to validate an XML document. Oracle's XML Developer Kit (XDK) offers a set of components, tools, and utilities for developing XML-based applications, and developers will find the detailed XDK coverage invaluable. Later chapters are given over to using XPath, transforming XML with XSLT, and using the JSTL XML Tag Library. Moving through the book, a chapter on the JAXB 2.0 API shows you how to bind, marshal and unmarshal XML documents, before we finally delve into comparing XML documents, and converting them into PDF and Excel formats. In all, this book will enable the reader to gain a good and wide-ranging understanding of what JDeveloper has to offer for XML processing.

Who is this book for?

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.

What you will learn

  • Learn what JDeveloper 11g can do for XML document generation.
  • Rapidly create, format, compare, and schema validate XML documents.
  • Master the built-in XML features in JDeveloper 11g including schema validation, the XSD Visual Editor for creating an XML schema, the XPath Search tool for selecting XML nodes with XPath, and the JAXB compiler for generating JAXB 2.0 Content Model from an XML Schema.
  • See how to work quickly and efficiently with the Oracle XML Developer Kit (XDK 11g)
  • Gain a valuable understanding of JAXP, XPath, XSLT, JAXB 2.0, DOM 3.0, and the JSTL XML Tag Library.
  • Convert XML to Excel and PDF formats, store XML in Oracle Berkeley DB XML, and create Oracle XML Publisher Reports.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 15, 2009
Length: 384 pages
Edition : 1st
Language : English
ISBN-13 : 9781847196675
Vendor :
Oracle
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : May 15, 2009
Length: 384 pages
Edition : 1st
Language : English
ISBN-13 : 9781847196675
Vendor :
Oracle
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just zł20 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just zł20 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 513.98
Oracle Advanced PL/SQL Developer Professional Guide
zł266.99
Processing XML documents with Oracle JDeveloper 11g
zł246.99
Total 513.98 Stars icon
Banner background image

Table of Contents

14 Chapters
Creating and Parsing an XML Document Chevron down icon Chevron up icon
Creating an XML Schema Chevron down icon Chevron up icon
XML Schema Validation Chevron down icon Chevron up icon
XPath Chevron down icon Chevron up icon
Transforming XML with XSLT Chevron down icon Chevron up icon
JSTL XML Tag Library Chevron down icon Chevron up icon
Loading and Saving XML with DOM 3.0 LS Chevron down icon Chevron up icon
Validating an XML Document with DOM 3 Validation Chevron down icon Chevron up icon
JAXB 2.0 Chevron down icon Chevron up icon
Comparing XML Documents Chevron down icon Chevron up icon
Converting XML to PDF Chevron down icon Chevron up icon
Converting XML to MS Excel Chevron down icon Chevron up icon
Storing XML in Oracle Berkeley DB XML Chevron down icon Chevron up icon
Oracle XML Publisher Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2
(5 Ratings)
5 star 40%
4 star 40%
3 star 20%
2 star 0%
1 star 0%
SOA Apr 02, 2010
Full star icon Full star icon Full star icon Full star icon Full star icon 5
processing XML document with Jdeveloper 11g is very book. I wanted to know all the features in Jdeveloper (wizards) that one would use in creating, processing XML, XSD, XPATH, XSLThis book really shows the illustrations in a simple step by step manner. I highly recommend anyone who want to FAST TRACK there XML, XSD, XPATH skills and use it in SOA, OR WebServices. 5 STARS.
Amazon Verified review Amazon
Suresh Krishna May 23, 2009
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Oracle XML Developer Kit (XDK) is a set of components, tools and utilities in Java which is available in Oracle Database, Oracle Application Server and on OTN that eases the task of building and deploying XML-enabled applications with a commercial redistribution license. XDK has several useful components such as XML Parsers, XSLT Processors, XSLT VM, XML Schema Processors, XML Java Beans, XML Class Generator, XML SQL Utility and XSQL Servlet.Oracle JDeveloper provides a rich set of tools and utilities for the XML processing. JDeveloper includes the XDK and any developer can make use of its powerful features to develop any XML based applications. Processing XML Documents with Oracle JDeveloper is a great book and i would highly recommend for everyone working with XDK, and JDeveloper.The author Deepak Vohra did a good job in describing the various steps for the XML Processing, XML Schema Validation, XPath Support, XML and XSLT Transformations. For more advanced users of XML, this book also talks about the topics such as Java XML Binding (JXB), API for comparing the documents, Converting XML to PDF, Converting XML to MS Excel, and finally storing the XML in Oracle Berkley DB XML.This book provides a quick reference guide to any developer who starts their XDK development using JDeveloper. Author emphasized well enough about the small details that every developer should know in XML processing. Author gives a good introduction about all the technologies that he talks and mentions the APIs in detail. I really liked the part where the author gives a complete java source code (in almost each chapter) along with the comments to explain the purpose of the following code. This book did a good job in setting up the context for running the applications. Author describes the steps to setup the extra environment variables to bet set, jars to be added and how to navigate in JDeveloper. With this sort of detailing, any developer could just look at the book and will be able to start the development right away. Also, the publisher, Packt extracted chapter (Chapter 4: XPath) from the book and you can find it here: [...]I would definitely recommend this book for the XML developers using XDK and JDeveloper.
Amazon Verified review Amazon
Serafeim Karapatis Aug 31, 2009
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The books that concern Oracle JDeveloper are very limited and this one really worth studying. The chapters are roughly organized in three major areas:- The Oracle XDK API capabilities for processing XML documents- The XML tools and visual editors that JDeveloper provides- The description of standardized or open-source XML libraries (such as those of Apache) that are commonly used in Java projects.All examples in the above areas are very well explained and are described in detail for the environment of JDeveloper 11g. In summary, the pace of the book is easy to follow, especially from a beginner perspective and the abundance of examples make it a perfect match for a reference book.[...]
Amazon Verified review Amazon
P. Barut Mar 29, 2009
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I would like to recommend a book Processing XML documents with Oracle JDeveloper 11g published by PacktPub.com. As I have some experience with XML processing inside Oracle DB (XMLDB) I was lacking the knowledge of XML manipulation in Java, especially using Oracle JDeveloper. This book is rather not for beginners - you should have basic knowledge of what is XML, at least theoretically. From the book you can learn how to manage XML Schemas in JDeveloper, then write XML documents based on those schema and finally validate them in JDeveloper or write Java code to validate it automatically. Chapters that I value much are those describing how to generate PDF documents. There are two methods described - one using Apache FOP API , and Oracle XML Publisher. As I was not generating PDF's this way so far, I found those 2 chapters very interesting. There is also chapter on generatin Excel by transformation of XML using Apache HSSF API .Book is very practical. If you want to start with subjects described above then this book is for you. Of course it does not mean that you do not have to study documentation. However, it will be easier for you to make first steps. Beside describing Oracle JDeveloper, author also shows how to install and use Oracle Berkley XML DB to store, query and update XML Documents - using command line and XML DB API.I especially recommend eBook version. All URLs in eBook version are active, so linking to web pages are very simple. Also coping sample code is easy. This book contains many practical and useful tips on XML processing and tools as well. So if those XML aspects are in your interest, then it's definitely good to invest in this book./Pawel
Amazon Verified review Amazon
KM Jun 02, 2009
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Recently I have been approached by Packt Publishing to review their recently released book "Processing XML documents with Oracle JDeveloper 11g" by Deepak Vohra. They were kind enough to send me an e-book, which suits more to a person like me who lives out of suitcase.Coming back to the point, as the book rightly mentioned, its objective is "to discuss XML development in Oracle JDeveloper" especially around JDeveloper 11g. JDeveloper has matured into a very robust IDE especially in J2EE and SOA arena. It's XML handling capabilities are worthy enough to be mentioned separately. In a way Gaurav did a very smart job of focusing on one topic rather than try to cover wider topics in shallow waters.First six chapters covers the basic of XML document, DOM, SAX, XSD, XSLT, XPath, JSTL XML taglibs. It was little bit an over-stretch for me, but I wouldn't discount it completely as it can be really helpful for somebody who is really starting from scratch (truly no exemption). Most of the examples covered in these chapters can be easily mapped to other parsers without much difficulties. Chapter seven, eight and nine are amongst the ones which interested me most. I like theory portion of DOM 3.0 LS.Chapter 10, 11, 12, 13 and 14 covers interesting and useful applied XML technologies like XMLDiff, XML2PDF, XML2XLS, Berkeley and XML Publisher. Chapters cover enough to give you a start but to deal with real life scenarios you might have to dig deeper. All in all these chapters might excite those who really like to try something new and different.Overall it's an easy read book which explains XML fundamentals in easy to understand language. I would definitely like this book as a beginner but it doesn't have a lot to offer at intermediate level. I would have like to see some literature around SDOM, AJAX, StAX. All in all this is a good beginners book covering XML and related technologies.[...]
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.