Realdolmen Education

Details

Java XML Processing

Deze cursus is momenteel niet ingepland op de open kalender, maar kan op aanvraag georganiseerd worden.

Cursus aanvragen

Aantal dagen

3 day(s)

Audience

Java consultants, programmers, and architects

Prerequisites

Having some Java experience, knowledge of XML, XPath, XSLT and of the common JEE APIs.

Objectives

In this course participants will learn how to use the Java APIs for XML (JAXP) to use XML in their Java Applications.

Methods

Intensive classroom training with practical exercises.

Description

XML is a very powerful tool for various reasons: it can be used for configuration, representing data, and for structuring and exchaning information. Its syntax is easy to use, and offers the possibility to describe information in a way that it can be understood by human readers as well as computers. Java supports the use of XML by providing a set of APIs to enable the parsing, manipulation and transformation of XML documents. This course will help you understand and use these APIs.

The course will begin with a summary of the basic XML concepts, to enable all participants to start at the same level. It will then show an overview of the different Java APIs and their uses. The course continues by showing the different possible uses of XML in Java programs. Afterwards, each API will be introduced individually, from SAX, DOM, StAX, and JDOM to JAXB and TrAX. The course will end its API overview with an introduction to Java Web Services.

During the course, participants will be able to gain practical knowledge in the use of these APIs during instructor-led exercises that will cover all the APIs. At the end of the course they will have enough understanding to be able to use XML in any Java Application.

The course does not cover the XPath and XSLT syntax used for transforming XML documents. Some previous experience with those technologies will be useful for a complete understanding of TrAX.

Contents

  • Introduction

    • Java XML Processing
    • Agenda
  • Summary of XML Basic Concepts

    • 7 XML statements
    • A brief history of XML
    • XML vs. SGML
    • XML vs. HTML
    • XML vs. SGML vs. HTML vs. XHTML
    • XML advantages
    • XML uses
    • Structure of an XML document
    • Criteria for well-formedness
    • A test for proper nesting ? OK
    • A test for proper nesting ? NOK!
    • XML namespaces
    • Additional remarks on XML syntax
    • XML schemas
    • Validity of XML documents
    • XML schema languages
    • Rendering XML using XSLT
    • XSLT-XPath interaction
    • XSLT Structure
    • A simple XSLT transformation
    • How does XSLT work?
    • How does XSLT work
    • The XSLT data model
    • Structure of an XSLT document
    • The XSLT translation process
    • A complete example
    • Steps in an XSLT application
    • XSLT Example
    • Essential XSLT elements
    • XPath examples
    • Displaying XML with CSS
    • XSL:FO (Formatting Objects)
    • XML to XSL-FO with XSLT
    • The XSL-FO transformation
    • Rendering engine: Apache FOP
    • XSL-FO document overview
    • The transformation process
    • XSL-FO document structure
    • XSL-FO example
    • XML support in Office 2003
    • WordML and other technologies
    • Physical storage of XML data
    • Example of XML support in SQL Server 2005
  • Overview of Java APIs for XML

    • Overview
    • Comparing SAX to DOM
    • Example
    • The JAXP packages
    • The JAXP JAR files
  • XML Uses and Best Practices

    • XML uses in applications
    • Using patterns: Builder
    • Using patterns: Visitor
  • SAX: Simple API for XML

    • SAX
    • Anatom y of a SAX application
    • SAX structure
    • SAX callback mechanism
    • SAXParser instantiation
    • class DefaultHandler
    • ContentHandler interface
    • Notes on ContentHandler methods
    • SAX exception handling
    • Additional event handling
    • Additional event handling
    • SAX Example
    • XML and Java Workshop
    • Workshop proposals
    • Exercise
  • DOM: Document Object Model

    • DOM
    • What is DOM?
    • The DOM Tree Structure
    • Tree View of an XML Document
    • Anatom y of a DOM application
    • DOM Structure
    • DocumentBuilder instantiation
    • DOM interfaces
    • The Document interface
    • DOM exception handling
    • DOM Level 2 and 3
    • Exercise
  • StAX: Streaming API for XML

    • Pull-type streaming API: StAX
    • Obtaining StAX
    • Anatom y of a StAX application
    • StAX example
    • StAX event types
    • StAX event interfaces
    • Testing StAX events
    • Document output with StAX
    • Exercise
  • JDOM: Java Document Object Model

    • Why another tree-based API?
    • The core JDOM classes
    • Constructors
    • Input and output
    • Input examples
    • Output examples
    • Creating documents and elements
    • Reading and accessing elements
    • The Namespace Class examples
    • Other possibilities of JDOM
    • Exercise
  • TrAX: Transformer API for XML

    • TrAX
    • JAXP XSLT Structure: TraX
    • How does the TrAX API work
    • Steps in a TrAX API application
    • TrAX API Example
    • Exercise
  • JAXB: Java Architecture for XML Binding

    • JAXB: Java Architecture for XML Binding
    • Marshalling and unmarshalling
    • JAXB example
    • Data binding, metadata and Schemas
    • When to use data binding
    • JAXB 1.0 overview
    • JAXB 2.0 overview
    • Finding JAXB
    • Working with JAXB: the JAXBContext
    • Compiling a Schema
    • The inverse: Creating a Schema from class
    • Simple marshalling
    • Simple unmarshalling
    • Schema validation when marshalling
    • More advanced JAXB uses
    • Exercise
  • Java XML Web Services

    • What is a web service?
    • History
    • Advantages
    • Disadvantages
    • XML technologies involved
    • The SOAP protocol
    • The WSDL descriptor
    • Web services in Java
    • JAX-WS
    • JAX-WS example
    • Exercise
  • Conclusion

    • Conclusion