XML with Java Course

Course Code: IN 302
Course Abstract: This course covers how to manipulate XML data in Java applications. It covers the 3 major Java APIs for XML: DOM, SAX and JAXP. It emphasizes creating parser-independent code for maximum code portability and maintainability. The course is an even mix of lecture and lab, providing several realistic examples of converting XML data to and from Java object data.
Audience: This course is designed for Java developers that need to manipulate XML data in Java applications.
Duration: 2 days
Learning Outcomes:

Upon completion of this course, the participant will be able to:
> Use the JAXP API to initialize XML parsers in a vendor-independent way
> Use the DOM API to read and manipulate XML data
> Use the SAX API for optimized XML data interpretation and error handling
> Convert XML data to and from Java objects

Course Topics:

Java APIs for XML
Using XML in Java
How XML Parsers Work
Popular Java XML Parsers
DOM
SAX
DOM vs. SAX
What is Missing
JAXP
JAXP and DOM
JAXP Error Handling
JAXP and SAX
Validating vs. Non-Validating
Other APIs: JDOM and JAXB
Java and Web Services
Review: Java APIs for XML
Lab: Java APIs for XML
 
DOM
The DOM Specifications
DOM Language Bindings
Major Java Classes for DOM
DOM Object Hierarchy
Node Objects
Node Methods: Data Retrieval
Node Methods: Navigation
Node Types
Node Name and Values
Node Children and Parents
Element Methods
Navigating the XML Tree
Starting Navigation
Navigating Using NodeLists
Alternate Navigation Algorithm
Searching for Elements
Targeting by Name or Position
Retrieving Data
JAXP and DOM
Review: DOM
Lab: DOM

Advanced DOM
DOM for Manipulating XML Data
Creating Documents with DOM
Creating an Empty Document
Creating a Document with a DTD
Document Methods
Node Methods: Altering Data
Element Methods: Altering Data
Examples: Creating Data
Example: Copying & Altering Data
Creating Leaf Element Nodes
Outputting DOM XML Data
Example: Outputting Data
Copying Data Between Documents
The Correct Way to Copy
Converting Object Data to XML
Generating XML as a String
DOM vs. String Concatenation
Review: Advanced DOM
Lab: Advanced DOM

SAX
History of SAX
DOM vs. SAX
Major Java Classes for SAX 2.0
How SAX Works
SAX Event Handlers
Types of Event Handlers
The DefaultHandler
JAXP and SAX
Example Custom Handler
Content Handler Methods
Start and End of Documents
The Start of Elements
Working With Attributes in SAX
The End of Elements
Character Data
Strange Aspects of character()
Working with Character Data
Ignorable Whitespace
Extended Example: Account XML
Extended Example: Account XML
Extended Example: Account XML
Review: SAX
Lab: SAX

Advanced SAX
The Locator Object
Using the Locator
Locator and File Position
Errors Types in SAX
Error Handler Methods
Customizing Error Behavior
Error Checker Example
Error Checker: Retrieving Errors
Fatal SAX Errors
Input Sources
Entity Resolver
Example: DTD Loader
SAX Event Handlers and JAXP
The XMLReader
Review: Advanced SAX
Lab: Advanced SAX

JAXP
JAXP
Java Classes for JAXP
Creating Factories and Parsers
JAXP Error Handling
DOM Factory Methods
SAX Factory Methods
DOM Builder Methods
SAX Parser Methods
Validation and DTDs
Schema Validation
Advanced DOM Errors and Entities
JAXP and Thread Safety
Installation and Configuratoin
XSL Transformation
Classes for JAXP Transformation
Source and Result Types
Transformer Factory Methods
Transformation Example
Transformation Exceptions
Detailed Error and URI Control
Templates and Thread Safety
Review: JAXP
Lab: JAXP

JAXB
Overview: JAXB
What is JAXB?
JAXB Architecture Overview
Advantages of JAXB
Typical JAXB Usage Scenarios
The JAXB Process
The xjc Stub Compiler
Binding the Schema
JAXB Generated Objects
Unmarshaling an XML Document
Marshalling an XML Document
Updating an XML Document
JAXB Validation
Customizing JAXB Bindings
Annotating the XML Schema
Using a Binding File
Review: JAXB
Lab: JAXB

Prerequisites: Experience with XML syntax (including DTDs) and the Java programming language required. Experience with XML namespaces suggested, but not required.
Note: All fields are required
At the present time we do not offer training for individuals or groups less then 6 individuals. We apologize for any inconvenience.
We Value Your Privacy!

Ready to get started or in need of more information? Contact us today.

Go To Blog Virtual Learning