Learning Patterns Your Source for Quality Technology Courseware

Fast Track to XML, XSLT and Java

This course provides a complete introduction to XM, the Java XML APIs, XPath, and XSLT. The course is a balanced mixture of theory and practical labs, designed to take students from the basic fundamentals of XML, providing mastery of the standard Java XML APIs, and moving on to advanced topics of XPath and XSLT. The students are walked through the different standards in a structured manner, to enable them to master the concepts and ideas, which are reinforced in the lab exercises.

The course starts with the fundamentals of XML including document structure, and XML Schema. It then moves on to the basic relationship between Java and XML, including generating XML from Java and the mapping between Java and XML objects. Finally, students are taken through a detailed and hands-on examination of the two main JAXP APIs – SAX 2.0 and DOM 2.0. It then moves on to the XPath and XSLT standards, and how to use them to transform XML documents into other documents such as HTML documents or other XML documents..

Course Information:

Course Code: FTXML

Price: $ 175

Duration: 5 days

Labs: many hands-on labs (minimum 50% of course)

Prerequisites: Working knowledge of Java programming, including use of inheritance, interfaces, and exceptions

Supported Software Environments:

  • Standard: Java 8 and Eclipse IDE
  • Other Available IDEs IntelliJ IDEA, IBM RAD (upon request)
(Non-standard software may require additional wait and incur additional charges.)

Course Objectives:

  • Understand what XML is, why it is useful, and how it is used
  • Understand the rules of XML and use the building blocks of XML to create well-formed XML documents
  • Create schemas for XML documents
  • Understand and use XML namespaces
  • Understand what an XML parser is and how to use one
  • Understand the different models of parsing XML documents (push, pull, and tree-based parsers)
  • Use SAX and DOM to parse XML documents
  • Be familiar with the StAX and JDOM parsers
  • Use JAXP initiate parsing
  • Learn to use XPath and XSLT for selecting/transforming XML documents
  • Use XPath to precisely locate and select portions of an XML document
  • Use XSLT to transform the selected XML into another form - XML, HTML, or some other data format

Course Outline:

  • Session 1: Introduction to XML
    • XML Defined
    • Benefits of Using XML, comparison to HTML
    • Origins of XML.
    • XML Standards
    • XML Usage Examples
  • Session 2: XML Basics
    • XML Document Structure
    • The document body
    • Elements, tags, and attributes, well-formed elements
    • Prolog, XML Declaration and PIs.
    • Entities, CDATA
  • Session 3: Namespaces
    • The Motivating Problem
    • The Namespace Solution (Definition, qualified names, URIs, prefixes)
    • Namespace scope and overriding
    • Default Namespaces
    • Namespaces and Attributes
  • Session 4: XML Schema
    • Valid XML documents, Schema languages, DTDs
    • XML Schema Basics
    • Schema form - Elements, Attributes and Types
    • Element Definitions
    • Simple and Complex Types
    • Primitive and Derived Datatypes
    • Complex Types - Sequence, Choice, All
    • Element Occurrence Constraints
    • Attribute Definitions
    • Attribute Occurrence Constraints
    • SimpleContent Type
    • Using XML Schema with Namespaces
    • [Optional] The Document Type Definition
      • Role and Function
      • Internal/External DTD
      • Elements and attributeds
      • CDATA, NMTOKEN
    • [Optional] XML Schema Advanced Topics
      • Element and Attribute Group Definitions
      • Deriving Simple Types
      • Deriving Complex Types
      • The any Types/li>
  • Session 5: XML and Java
    • How Java and XML work together.
    • Simple generating of XML from Java Objects
    • Parsing XML - Push (SAX), Pull (StAX), Tree (DOM)
    • JAXP, SAX 2.0, StAX 1.0, DOM APIs
    • Instantiating Parsers with JAXP
    • SAXParserFactory/SAXParser
    • DocumentBuilderFactory/DocumentBuilder
  • Session 6: SAX
    • Primary Components of SAX
    • Setting up for a Parse
    • Handling Document Errors
    • Handling Document Content
    • SAX Features and Properties
    • SAX Extensions
  • Session 7: DOM
    • What is DOM?
    • XML Document as a DOM Tree
    • Getting a DOM Tree from the Parser
    • Manipulating the DOM Tree
    • Transforming a DOM Tree Back to XML
  • Session 8: eXtra Topics
    • StAX Parser Overview
    • Performance Issues
    • JAXB Overview
    • JDOM Overview
  • Session 9: XPath (XML Path Language)
    • Overview of the XPath standard.
    • XPath data model – why we need it.
    • Tree addressing and node types.
    • XPath Expressions
    • Working with location paths – step by step.
    • Absolute and relative location paths
    • Axis specifiers, predicates, and functions
    • Lab: Node Trees, Names, String-values
    • Lab: Location Paths and Axes
    • Lab: Predicates, Functions, Operators
  • Session 10: XSLT (Extensible Stylesheet Language Transformations) Basics
    • XSLT Overview and History
    • Stylesheets, Templates, and the XSLT Process
    • Processing child nodes
    • Default templates
    • Writing templates – xsl:template
    • Continuing Processing – xsl:apply-templates
    • Lab: Default Template Rules
    • Lab: Writing Templates
  • Session 11: Transforming XML to XML
    • xsl:copy-of
    • xsl:copy
    • Pruning the result tree
    • Attribute Value Templates
    • Controlling output with xsl:output
    • Whitespace handling
    • Lab: Pruning the Source Tree
    • Lab: Creating a summary XML document
  • Session 12: Transforming XML to HTML
    • Fundamental approach
    • HTML elements in an XML document
    • Basic HTML Tables
    • Considerations in generating tables
    • Lab: Transforming an XML order document to HTML
  • Session 13: Conditional Processing
    • Overview
    • xsl:if
    • xsl:choose, xsl:when, xsl:otherwise
    • Lab: Using Conditional Processing