Ajax Training: Ajax for Java Developers
EJB Training: Introduction to Enterprise Java Beans
Groovy for Java Developers
Hibernate Training
Intermediate Java Training
Introduction to Java Programming Training
Introduction to XML Training
Jakarta Struts Training
Java Development for Secure Systems
Java EE 5 (JEE - including EJB3)
Java Programming with Eclipse
JavaServer Faces (JSF) : Using JSF to Build J2EE Web Apps on the JBoss Application Server
JavaServer Faces Training: Introduction to JSF Training
JavaServer Pages Training: Introduction to JSP and Servlets Training
JBoss Training: Administering the JBoss 4.x Application Server
JBoss Training: Administering the JBoss® 5.X Application Server
JBoss Training: Enterprise JavaBeans (EJB 3) on the JBoss Application Server
JBoss Training: Enterprise JavaBeans 3.0 (EJB3) and the Java Persistence API (JPA) on the JBoss Application Server
JBoss Training: Java EE with Servlets JSP & JDBC on JBoss AS
JBoss Training: Servlets/JSP on the JBoss Application Server
JBoss Training: SOA and Java Web Services (JAX-WS) on the JBoss Application Server
Patterns In Frameworks Workshop
Software Design Training: Effective Software Development Training Boot Camp
Spring Framework Training (Spring 3)
Test Driven Development (TDD) for Java
The JSP Standard Tag Library (JSTL)
Web Development Using Grails Training
Web Services Training: Developing Java Web Services
XML Programming Using Java
    

XML Programming Using Java

  Course #:  NT542
  Duration:  4 days

XML Training Overview

nTier's XML Programming Using Java course builds skills in Java's XML processing APIs. The course is intended for students with a working knowledge of XML -- and possibly DTDs or XML Schema -- who want to build XML applications or components using the Java language. Everything in the course adheres to W3C and Java standards for completely portable code.

The course comprises three modules, which treat XML parsing, XML transformations, and XML binding. The first module introduces the Java API for XML Processing (JAXP) and the two main Java APIs for parsing XML documents: SAX and the DOM. Students learn the basic JAXP architecture and how to create parsers that expose SAX or DOM APIs, and how to configure parsers according to the SAX features and properties specification. SAX parsing gives way to reading and writing document information using the DOM tree model and API.

The second module introduces students to the XPath and XSLT specifications, and how to use JAXP as an interface to XML addressing and transformations. Students learn the JAXP's innovative system of Transformers, Sources, and Results; develop fluency in the exacting but powerful XPath syntax; and then build a number of XSLT transformations.

The third module introduces the newer and more powerful Java API for XML Binding, or JAXB, in its current incarnation, which is version 2.1. JAXB is now emerging as the tool of choice for most XML processing tasks where an XML Schema is available or easy to derive: based on that schema, JAXB-generated types can make it quite easy to read, manipulate, and write XML information models.

XML Training Learning Objectives

  • Understand the use of SAX and DOM APIs for XML parsing.
  • Understand the need for JAXP as an additional layer to the standard contract between applications and parsers.
  • Use JAXP to write entirely portable XML parsing code.
  • Parse element and attribute content, processing instructions, and other document information using SAX.
  • Parse documents using the DOM.
  • Modify, create and delete information in an XML document using the DOM.
  • Use DOM Traversal to simplify and make parsing algorithms more effective.
  • Use DOM Mutation Events to track changes to an XML document.
  • Use the JAXB to generate persistent Java object models based on XML Schema.
  • Implement XML persistence using the JAXB.
  • Write simple and complex queries into XML document content using XPath.
  • Use XSLT for XML-to-XML transformations.
  • Use the built-in template rules correctly to process the right source information.
  • Use mode and priority to control template matching.
  • Control exact production of text, HTML and XML elements, and whitespace.
  • Derive source document content and make copies of node trees.
  • Use looping and conditional processing to manage output production.
  • Build J2SE and Web applications that leverage XSLT transformation logic

XML Training Prerequisites

  • Experience in Java Programming, including object-oriented Java and the Java streams model, is essential.
  • Basic understanding of XML is required.
  • XML Schema is used peripherally in the course, and knowledge of this technology will be helpful, but is not required.

XML Training Outline

Module 1 – XML Parsing Using Java

  1. The Java API for XML Processing (JAXP)
    • Parsing XML
    • SAX and DOM
    • What the W3C Says
    • What the W3C Doesn't Say
    • Sun and Apache
    • JAXP Parser Factories
    • Pluggable Parsers
    • Parser Features and Properties
  2. The Simple API for XML (SAX)
    • 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
    • Handling Processing Instructions
  3. The Document Object Model (DOM)
    • Origins 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
    • Combining SAX and DOM
    • Processing Namespaces and the DOM
  4. Manipulating XML Information with the DOM
    • Modifying Documents
    • Modifying Elements
    • Modifying Attributes
    • Managing Children
    • Seeking a Document Location
    • The ProcessingInstruction Interface
    • Creating New Documents
  5. DOM Level 2 Modules
    • DOM Traversal
    • The DocumentTraversal Interface
    • Node Filters
    • The NodeIterator Interface
    • The TreeWalker Interface
    • DOM Ranges
    • DOM Events
    • Mutation Events
    • Handling Events
    • Event Flow
    • Capturing and Bubbling
    • Cancelable Events
  6. XML Serialization and the Java API for XML Binding (JAXB)
    • XML for Object Persistence
    • Persistence Strategies
    • The Memento Pattern
    • Deserialization with SAX
    • Object Persistence with the DOM
    • Adapting Object Models to the DOM
    • The Java API for XML Binding
    • Marshalling, Unmarshalling, and Validation
    • Schema as Object Models
    • UML for XML Mapping
    • XML to Java: Simple Types, Complex Types, and Collections Object Factories
    • Customizing JAXB Bindings
    • The DOM vs. JAXB
    • JAXB for Persistence
    • Automatic Translation

Module 2 – XML Transformations Using

  1. 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
  2. XPath
    • Use of XPath in Other XML Technologies
    • XPath Expressions
    • The Axis
    • The Node Test
    • The Predicate XPath Types
    • XPath Functions
    • Implied Context Querying with XPath
    • XPath and the DOM
  3. 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
  4. XSLT: Dynamic Content and Flow Control
    • Web Applications
    • Using XSLT
    • J2EE and JAXP
    • Deriving Source Content
    • Getting Source Values
    • Attribute Value Templates
    • Copying Source Elements and Trees
    • Looping Conditionals
    • Learning Resources
    • Quick Reference: W3C Namespaces
    • UML for XML Schema
    • Quick Reference: XML and DTD Grammar
    • Quick Reference: XPath and XSLT

Module 3 – The Java API for XML Binding

  1. 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 Annotations
    • Marshaling and Unmarshaling
    • Working with JAXB Object Models

Appendix A.  Learning Resources

System Requirements
Hardware – minimal: Pentium 500MHz, 128 meg RAM, 500 meg HD.
Hardware – recommended:   Pentium 1.5gHz, 512 meg RAM, 1 gig HD.
Operating system:

Tested on Windows XP Professional. The course software should be viable on all Windows or Linux systems which support J2EE 1.4.