First Technology Transfer

Standard and Advanced Technical Training, Consultancy and Mentoring

Course JAV109 - Java XML Programming

Duration: 4 Days

Intended Audience

This course is aimed for Java programmers who need to learn how to manipulate XML from within Java code. Practical experience of using Java to write applications is essential. A knowledge of XML basics is helpful, but is not essential, as the relevant aspects of XML will be covered fully.

Synopsis

XML represents an important way of representing, transmitting and storing data in a platform and application independent format. This course provides an in-depth introduction to XML is and how to use it in Java applications. It covers the major XML technologies that are commonly used within Java applications.

Course Outline

  • Introduction
    • Overview of XML
    • XML, XHTML and HTML
    • Uses of XML
  • XML Basics
    • Document structure
    • XML declaration
    • Processing instructions
    • Elements
    • The Root Element
    • Attributes
    • CDATA and escaping special characters
  • Namespaces in XML
    • The need for namespaces
    • Defining namespaces
    • Default namespaces
    • Using namespaces correctly
  • Validation with DTDs
    • Overview of DTDs
    • Defining elements and attributes
    • Defining entities
    • DTDs and namespaces
  • Validation with XML Schema
    • Introduction to XML Schema
    • Schemas and DTDs
    • Defining elements and attributes
    • Defining simple types and complex types
  • The Java API for XML Processing (JAXP)
    • Parsing XML
    • SAX and DOM
    • What the W3C Says and Does Not Say
    • Oracle-Sun and Apache
    • JAXP
    • Parser Factories
    • Pluggable Parsers
  • Parsing using SAX (Simple API for XML)
    • Origins of SAX
    • The SAX Parser
    • The SAX Event Model
    • Reading Document Content
    • Handling Namespaces
    • SAX Features for Namespaces
    • Parsing Attributes
    • Error Handling
    • DTD Validation
    • Schema Validation
  • Tree Parsing using DOM (Document Object Model)
    • Origins of the DOM
    • DOM Levels
    • DOM2 Structure
    • Stream parsing versus tree parsing
    • Building a DOM tree - 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
    • Combining SAX and DOM Processing
    • Namespaces and the DOM
    • Modifying content
    • Error handling and validation
  • Manipulating XML Information with the DOM
    • Modifying Documents
    • Modifying Elements
    • Modifying Attributes
    • Managing Children
    • Seeking a Document Location
    • The ProcessingInstruction Interface
    • Creating New Documents
  • Using the JAXP for Transformations
    • XPath, XSLT and Java
    • The Transformer Class
    • The TransformerFactory Class
    • Sources and Results
    • Identity Transformations
    • Creating Transformations from Stylesheets
    • Template Parameters
    • Output Methods and Properties
    • Evaluating XPath Expressions
  • Using XPath in Java
    • XPath Expressions
    • The Axis
    • The Node Test
    • The Predicate
    • XPath Types
    • XPath Functions and Operators
    • Filtering results
    • Implied Content
    • Querying with XPath
    • XPath and the DOM
  • Templates and Production
    • Rule-Based Transformations
    • Templates and Template Matching
    • Built-In Template Rules
    • Recursion Through Templates
    • Template Context
    • Output Methods
    • Controlling Whitespace
    • Literal Replacement Elements
    • Formalizing Text, Elements and Attributes
    • Defining Target Vocabulary
    • Generating Processing Instructions
  • XSLT: Dynamic Content and Flow Control
    • Overview of XSLT
    • Using XSLT in Java
    • Defining overloaded template rules
    • Loops and decision making in XSLT
    • Sorting results
    • Defining and calling named template rules
    • Parameterising template rules
    • Using JAXP transformers
    • Web Applications Using XSLT
    • J2EE and JAXP
    • Deriving Source Content
    • Getting Source Values
    • Attribute Value Templates
    • Copying Source Elements and Trees
  • The Java API for XML Binding
    • The Need for Data Binding
    • XML Schema
    • Two Paths
    • JAXB Compilation
    • Mapping Schema Types to Java
    • Java-to-XML Mapping Using Annotation
    • Marshaling and Unmarshaling
    • Working with JAXB Object Models