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
Conferences
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
$9.99 $36.99
Paperback
$60.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781847196668
Vendor :
Oracle
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : May 15, 2009
Length: 384 pages
Edition : 1st
Language : English
ISBN-13 : 9781847196668
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 $5 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 $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 126.98
Oracle Advanced PL/SQL Developer Professional Guide
$65.99
Processing XML documents with Oracle JDeveloper 11g
$60.99
Total $ 126.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.