|
Provided by: Boston University Corporate Education Center Java and XML Development WorkshopUnfiled |
![]() |
Java and XML Development Workshop (ITP867)
|
|
||||||||||
ITP867 - Java and XML Development Workshop
Course description
This comprehensive course gives the student a solid working knowledge of the core XML language, Java parsing technologies (SAX and DOM), XML transformations (XSLT), and XML Schema. It is intended for students who want to build XML applications or components using the Java language and standard APIs to solve enterprise programming problems.
The course presents what might be called “Pure XML” along with “Pure Java”. That is, everything in the course is based strictly on W3C and Sun-sponsored specifications, without any vendor-specific extensions or productivity tools. Thus the hands-on exercises, and the knowledge that is developed, are portable and applicable to any Java/XML authoring or development effort.
The first module introduces XML, giving an overview of its use in the industry and motivations for adoption. The basic grammar of well-formed XML documents is studied, including proper use of attributes, empty elements, mixed content, and nested elements. Then students move on to valid XML, learning to write DTDs and XML documents that will validate against the DTDs. This includes work with various attribute types such as enumerations, IDs and IDREFs. Students learn the limitations of the DTD grammar, and also techniques for working around those limitations using entities to express data designs effectively.
The second module introduces the 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 is covered, working from simple SAX event handling through patterns for understanding document content from event sequences, to error handling and document validation. Students then learn how to read document information using the DOM’s tree model and API, and move on to using the DOM to modify and to create new documents and information nodes. The final chapter of this module covers two of the more significant DOM2 modules, Traversal and Events, each with a design overview and hands-on exercises.
The third module introduces students to the XPath and XSLT specifications, and how to use JAXP as an interface to XML transformations. Students learn the basic JAXP Transformer architecture, develop fluency in the exacting but powerful XPath syntax, and then build a number of XSLT transformations. Study of XSLT is arranged first to develop control over output production, including a solid understanding of the sometimes mysterious built-in template rules, template matching, priority and modes, and control of whitespace production. Then students turn towards the source document and learn to extract single values, to make shallow and deep copies of source elements, to use variables, and to use flow-control constructs to effect conditional processing and loops.
The remaining module treats the new XML Schema recommendation. Students review the shortcomings of the DTD for expressing type information, and learn how to use XML Schema to create strict document models. Schema data types and structures are studied, allowing precise grammar and validation rules to be defined for document content. Students use the Xerces 2 parser and JAXP to validate their schemas and instance documents, getting plenty of hands-on experience in basic schema design. (A second module on “Advanced XML Schema” is not part of this one-week course, but is available from Object Innovations which introduces keys and key references to associate elements based on key fields, and covers complex-type extension as well as use of multiple namespaces and schema.)
Prerequisites
Experience in Java Programming, including object-oriented Java. Some familiarity with HTML will be beneficial, but is not strictly required.
What you will achieve
- Understand the broad influence of XML on emerging software architectures.
- Write well-formed XML documents to express simple or complex document content.
- Write DTDs to set rules for XML document validation.
- Write valid XML documents with internal and/or external document type definitions.
- Understand the limitations of DTDs in expressing document and object designs and in setting strict validation rules.
- Read and write XML using namespaces to import type information and to partition the XML namespace.
- 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.
- 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.
- Develop XML Schema to express precise type information for an XML document.
- Associate schema with XML instance documents.
- Validate instance documents against associated schema.
- Define simple types, and use value restrictions and enumerations to constrain values.
- Define list types and union types.
- complex types, including simple types and other complex types, and empty- and mixed-content types.
What you will learn
- Volume 1: Introduction to XML (1 day)
1. A Brief History of XML
- Birth of XML
- Content vs. Presentation
- Self-Describing Data
- A Standard Document Format
- XML and Relational Data
- XML and Object Models
- The Need for Validation
- Programmatic Use of XML
- XML Transformations
- XML for Messaging
- Web Services
2. XML Grammar
- Structure of an XML Document
- Handling Whitespace
- Character and Entity References
- Well-Formed XML
- Elements
- Attributes
- Processing Instructions
- Comments
- CDATA Sections
3. Document Type Descriptors
- Document Types
- Internal and External Subsets
- PUBLIC vs. SYSTEM
- DTD Structure
- Defining Elements
- Cardinality
- Attributes
- Required, Implied, Default, and Fixed Attributes
- Enumerations
- IDs and IDREFs
- Entities
- Conditional Sections
- Limitations of DTDs
- Techniques Using Entities
- XML Schema
- XML Namespaces
Volume 2, Module 1: XML Parsing Using Java (2 days)
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
- XML for Object Persistence
- The Memento Pattern
- Serialization with SAX
- Other XML Serialization Tools
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
- Object Persistence with the DOM
- Adapting Object Models to the DOM
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
Volume 2, Module 2: XML Transformations Using Java (1 day)
1. JAXP for Transformations
- XPath, XSLT and Java
- The Transformer Class
- The TransformerFactory Class
- Sources and Results
- Identity Transformations
- Creating Transformations from Stylesheets
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
3. XSLT: Templates and Production
- XSL and XSLT
- Rule-Based Transformations
- Output Methods
- Templates and Template Matching
- Built-In Template Rules
- Recursion Through Templates
- Controlling Whitespace
- Template Context
- Literal Replacement Elements
- Formalizing Text, Elements and Attributes
4. XSLT: Dynamic Content and Flow Control
- Deriving Source Content
- Getting Source Values
- Attribute Value Templates
- Copying Source Elements and Trees
- Defining Target Vocabulary
- Generating Processing Instructions
- Variables
- Result Tree Fragments
- Looping
- Conditionals
- Calling Templates as Functions
- Sorting
- Number Formatting
Volume 3: Introduction to XML Schema (1 day)
1. Getting Started with XML Schema
- What is an XML schema?
- Schemas vs. DTDs
- Structure of a Schema
- Associating Schema with Documents
- Types of Types
- Defining Elements
- Defining Complex Types
- Validation
2. Simple Types
- Simple and Atomic Types
- Built-In Types
- Primitives
- Numeric Derived Types
- String Derived Types
- Simple Type Restriction
- Facets
- Value Ranges
- Enumerations
- Patterns
- Lists
- Unions
- Nillable Values
3. Complex Types
- Model Groups
- Sequences, Conjunctions, and Disjunctions
- Particles
- Occurrence Constraints
- Global and Local Definitions
- Defining Attributes
- Empty, Any, and Mixed Content
- Model Group Definitions
- Attribute Group Definitions
- Annotations
|
Boston University Corporate Education Center, operated by TechSkills LLC 72 Tyng Road | Tyngsboro, MA 01879 | 1.800.288.7246 Copyright © 1997 - 2007 Boston University Corporate Education Center |

