First Technology Transfer

Standard and Advanced Technical Training, Consultancy and Mentoring

Processing XML Documents with Java

Duration: 3 Days

Intended Audience and Prerequisites

This course is aimed at programmers and IT specialists with a knowledge of XML – and possibly DTDs or XML Schema – who need to build XML applications or components in Java.

Synopsis

The goals of this course are to develop skills in working with the Java XML processing APIs. The focus is on parsing XML documents using SAX and DOM and executing transformations on documents using XSLT stylesheets. The course covers the Java API for XML Processing, or JAXP, as well as JAXB (Java API for XML Binding) and XML document serialisation according to XML Schema.

Contents:

  • Java API for XML Processing (JAXP)
    • Parsing XML - SAX and DOM approaches
    • JAXP
    • Parser Factories
    • Pluggable Parsers
    • Features and Properties of Parsers
  • The Simple API for XML (SAX)
    • History of SAX
    • Architecture of the SAX Parser
    • The SAX Event Model
    • Reading Document Content
    • Dealing with Namespaces
    • SAX Features for Namespaces
    • Parsing Attributes
    • Error Handling
    • DTD Validation
    • Schema Validation
    • Handling Processing Instructions
  • The Document Object Model (DOM)
    • History of the DOM
    • DOM Levels
    • DOM2 Structure
    • The Document Builder
    • DOM Tree Model
    • DOM Interfaces
    • Document, Node and NodeList Interfaces
    • Element and Text Interfaces
    • Finding Elements By Name
    • Walking the Child List
    • The Attribute Interface
    • Traversing Associations
    • The JAXP Transformer Class
    • Sources and Results
    • Using SAX and DOM Processing together in an application
    • Namespaces and the DOM
  • Manipulating XML with the DOM
    • Modifying Documents
    • Modifying Elements
    • Modifying Attributes
    • Managing Children
    • The Processing Instructions Interface
    • Creating New Documents
  • JAXP for Carrying Out Document Transformations
    • XPath, XSLT and Java
    • Transformer Class and TransformerFactory Class
    • Sources and Results
    • Identity Transformations
    • Creating Transformations from Stylesheets
    • Template Parameters
    • Output Methods and Properties
    • XPath Expression Evaluation
  • XPath
    • XPath Expressions
    • Axis
    • Node Test
    • Predicate
    • XPath Types
    • XPath Functions
    • Implied Content
    • Querying with XPath
    • XPath and the DOM
  • Templates
    • XPath, XSLT and Java
    • Transformer Class
    • TransformerFactory Class
    • Sources and Results
    • Identity Transformations
    • Creating Transformations from Stylesheets
    • Template Parameters
    • Output Methods and Properties
  • Templates and Production
    • Rule-Based Transformations
    • Templates and Template Matching
    • Built-In Template Rules
    • Using Templates for Recursion
    • Template Context
    • Output Methods
    • Controlling Whitespace
    • Literal Replacement Elements
    • Formalizing Text, Elements and Attributes
    • Defining a Target Vocabulary
    • Generating Processing Instructions
  • XSLT Flow Control and Dynamic Content
    • Using XSLT for Web Application Document Processing
    • J2EE and JAXP
    • Deriving Source Content
    • Getting Source Values
    • Attribute Value Templates
    • Copying Source Elements and Trees
    • Looping
    • Conditionals
  • The Java API for XML Binding
    • The Need for Data Binding
    • XML Schema
    • JAXB Compilation
    • Mapping Schema Types to Java
    • Java-to-XML Mapping Using Annotations
    • Marshaling and Unmarshaling
    • Understanding and Using the JAXB Object Models