XML with Java and Transformations Course

Course Code: IN 341
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. This version of the course also includes a discussion of XSLT transformations, to better demonstrate the proper use of the JAXP transformation packages.
Audience: This course is designed for Java developers that need to manipulate XML data in Java applications.
Duration: 3 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 using JAXB
> Perform XSL Transformations in Java applications

Course Topics:

Java APIs for XML
Overview: 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
Overview: 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
Overview: 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
Overview: 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
Using the Account Handler Review: SAX

Advanced SAX
Overview: 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
Overview: 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: Java Architecture For XML Binding
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
Unmarshalling An XML Document
Unmarshalling (Cont.)
Marshalling An XML Document
Marshalling (Cont.)
Updating An XML Document
Updating (Cont.)
JAXB Validation
Customizing JAXB Bindings
Annotating The XML Schema
Annotating The Schema (Cont.)
Using A Binding File
Review: JAXB
Lab: JAXB

XSLT Fundamentals
Overview: XSLT Fundamentals
History of XSLT
XSLT Processing
XSLT Processors
Some Uses of XSLT
XSLT Structure
Basic Terminology
XSLT Elements
Data Model
Tree Nodes
Source Tree to Result Tree
Templates
Multiple Templates
Invoking Templates for Children
Printing Out Data
Walking the Source Tree
More Generic Template Matches
Default Templates
Using Default Templates
Advanced Template Match Patterns
Advanced Apply-Templates
Tools
Review: XSLT Fundamentals
Lab: XSLT Fundamentals

XPath
Overview: XPath
Xpath
Data Model
Tree Nodes
Document Order
XPath Data Types
Location Paths
Location Paths and the XML Tree
Abbreviated XPath Syntax
Abbreviated Examples
Full XPath Syntax
Node Tests
XPath Axes
Targeting Attributes
Axes Examples
Predicates
Abbreviated Syntax Revisited
Multiple Predicates
Predicate Order
Unions of Multiple Paths

Xpath Expressions
Overview: XPath Expressions
XPath Data Types
Data Type Conversions
Functions Types
Boolean Functions
Number Functions
String Functions
More String Functions
The translate() Function
Node-Set Functions
The id() Function
Functions Applied to Context Node
Node Type Test "Functions"
Arithmetic Operators
Boolean Operators
Comparisons with Node-Sets
Negating Comparisons
Example XML
Context and Position
Position Counting
Forward and Backward Axes
XPath to Calculate Values
XPath Expressions in Predicates
Review: XPath Expressions
Lab: XPath Expressions

XSLT Templates
Overview: XSLT Templates
Walking the Source Tree
Context and Current Nodes
Determining Matches
Determining the Current Node List
Current Node List and Matches
Default Template Rules
Conflicts in Template Matches
Default Priorities
Endless Recursion and Modes
Typical Uses for Template Modes
Template Contents
Literal Result Expressions
Common XSLT Instructions
<xsl:value-of>
XSLT Conditionals
<xsl:for-each>
Nested Loops
<xsl:text>
Review: XSLT Templates
Lab: XSLT Templates

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