Processing and Transforming Documents using XPath and XSLT
Duration: 3 Days
Intended Audience and Prerequisites
This course is aimed at Designers, architects, and developers who need to manipulate and transform XML documents using XPath and XSLT. Attendees are assumed to have a basic knowledge of XML and HTML.
Synopsis
XML is a de-facto standard for exchanging data between applications and organisations. XPath and XSLT are standard ways of accessing and transforming content in an XML document. This course explores the XPath language in detail, showing how to locate XML content by value, position, and type. It then goes on to explain the use of XSLT to transform XML documents into a different dialect of XML, HTML, or a text format such as EDI files. It also covers XPath and XSLT techniques for filtering unwanted data, and generating new XML content from scratch. It covers both the 1.0 and 2.0 versions of the XPath and XSLT standards. The course covers both the theory and practice of working with XPath and XSLT and includes practical exercises and examples for
- Locating content in an XML document using XPath
- Transforming XML documents using suitably written XSLT stylesheets
- Generate new XML content using XSLT
- Sorting documents, and controlling textual and numeric output
- Define and use named templates in stylesheets
- Coordinating multiple XML documents using style sheets
Contents:
- XML- An Overview
- XML syntax, structure and formatting and well formed documents
- Namespaces
- Specifying and defining XML grammars formally
- XML Schemas
- XSLT and XPath Introduction
- What is XPath?
- What is XSLT?
- Rationale underlying the development of XPath and XSLT
- Transforming XML documents using XPath and XSLT
- Generating XML and/or HTML output
- Selecting XML Nodes using XPath
- XPath nodes and properties
- Axes, node tests, and predicates
- Location paths and location steps
- Accessing elements and attributes
- Accessing other node types
- Filtering nodes using predicates
- Using XPath operators and functions
- Writing and Applying XSLT Style Sheets
- XSLT style sheet structure
- Defining template rules
- Obtaining node values
- Invoking template rules
- Literal result elements
- Applying a style sheet to an XML document
- Applying a style sheet dynamically using DOM
- The XSLT Programming Language
- Performing iteration
- Making decisions
- Creating named templates
- Calling named templates
- Defining and using variables
- Defining and using parameters
- Fine Control of XSLT Output
- Formatting numbers
- Sorting the result tree
- Controlling whitespace
- Character encodings
- Specifying XML, HTML, and plain text output methods
- Mapping XML dialects with XSLT
- Creating new XML content with XSLT
- Creating elements
- Creating attributes
- Namespace issues
- Generating and formatting text content
- Creating numeric output
- Creating other XML content
- Implementing Scalable Solutions with XSLT
- Including style sheets
- Importing style sheets
- Overriding imported template rules
- Invoking overridden template rules
- Specifying template priorities
- Managing multiple XML documents and Grouping
- Accessing multiple XML documents
- Accessing XML data with keys
- Generating cross references in XML documents
- Standard techniques used to achieve group by functionality
- XPath 2.0
- Differences between XPath 2.0 and XPath 1.0
- Introducing data types and sequences
- Querying with 2.0
- Using for, some and every keywords
- Use of if statements
- Set operations
- Functions and Type casting
- XSLT 2.0
- Data types and strong typing
- Grouping
- User defined Functions
- Creating multiple output documents
- Generating sequences
- Processing data with regular expressions
- Controlling template processing