Transforming XML with XSLT

Code: 50063
Course duration: 2 days

50063: Transforming XML with XSLT (2 Days)

About this Course

This two-day instructor-led course provides students with the knowledge and skills to use the XSLT language to process XML data into another markup format like HTML or WAP. You'll learn about the origins and current state of XSLT and how to create simple "blueprint" style sheets. You'll find out about XPath, another XML technology, and learn how to use it to navigate to any node in an XML tree. You'll discover how to use rule-based style sheets to create powerful and flexible style sheet applications. You'll also learn how XSLT differs from procedural programming languages and how to apply the programming knowledge you already have to this new language and environment.

Audience Profile

This course is intended for:

  • Application developers who need to implement XML-based solutions.
  • System architects who want to understand how XSLT can be integrated into the system design of XML-based applications.

At Course Completion

After completing this course, students will be able to:

  • Create both simple “blueprint” style sheets to provide quick transformations of XML data and complex XSLT-based applications that use multiple XML data sources and multiple style sheets.
  • Use XPath to navigate an XML tree and get values from text nodes and attributes.
  • Determine the best place and time to process a given transformation.
  • Create rule-based style sheets that are easy to maintain and extend.
  • Use variables to build attribute values and store default values.
  • Design named templates that act as subroutines in an XSLT style sheet.

Course Outline

Module 1: Introduction to XSLT

This module explains how XSLT was devised, what it looks like, and how it differs from procedural programming languages. This module also explains some common types of XSLT transformations and how a transformation is processed.

Lessons

  • What Is XSLT?
  • Are You Sure This Is a Language?
  • Transformation Types
  • XSL Processing

After completing this module, students will be able to:

  • Understand why XSLT was devised.
  • Understand what XSLT looks like and how it differs from procedural programming languages.
  • Discover some of the common types of XSLT transformations.
  • Understand how a transformation is processed, given an XML file and an XSLT file.

Module 2: Simplified Style Sheets

This module explains how to create simple XSLT style sheets using the simplified style sheet syntax, describes which attributes are required by an XSLT style sheet, and how to extract a text node from an element.

Lessons

  • The Essential Style Sheet
  • Using an XSL Blueprint to Create HTML
  • What Can't a Simplified Style Sheet Do?

Lab : Simplified Style Sheets

  • Overview
  • Create an HTML Page
  • Build a Table from a XML Node-Set
  • Sort Nodes Alphabetically

After completing this module, students will be able to:

  • Create simple XSLT style sheets using the simplified style sheet syntax.
  • Understand which attributes are required by an XSLT style sheet and what their values should be.
  • Extract a text node from an element and insert it into the transformation result tree.
  • Use XSLT control structures to branch and loop within a style sheet.
  • Use the <xsl:sort&rt; element.

Module 3: Get Around with XPath

This module explains how XPath is used in XSLT and how to navigate nodes in an XML document.

Lessons

  • What Is XPath?
  • Figure Out Location Steps
  • Introduction to XPath Functions

Lab : Get Around with XPath

  • Overview
  • Find Certain Ancestors of a Node
  • Use XPath Functions to Build a String from a Node-Set

After completing this module, students will be able to:

  • Understand how XPath is used in XSLT.
  • Navigate nodes in a XML document.
  • Use XPath functions to do string manipulations and numeric calculations within an XSLT style sheet.

Module 4: Add Template Rules

This module explains how default templates are applied, what is the full syntax for creating an XSLT style sheet, and how to apply a template with the <xsl:apply-template&rt; element.

Lessons

  • What Are Templates
  • Un-simplifying the Style Sheet
  • Using the Template Element
  • Other Top-Level Elements

Lab : Add Template Rules

  • Overview
  • Create and Process a Style Sheet
  • Create a Table of Children
  • Create a Heading Showing Parent Names

After completing this module, students will be able to:

  • Understand the default templates and how they are applied.
  • Understand the full syntax for creating an XSLT style sheet.
  • Work with the <xsl:template&rt; element and its match attribute.
  • Apply a template with the <xsl:apply-template&rt; element.

Module 5: Traditional Programming Concepts and XSLT

This module explains how to create variables that are used in XSLT style sheets, explores named templates and parameters, and explains the functions that are defined in the XSLT specification.

Lessons

  • Programming Concepts You Can Use
  • Work with Variables
  • Call Named Templates
  • Use Functions
  • Create Modular Style Sheet Solutions

Lab : Traditional Programming Concepts and XSLT

  • Overview
  • Use a Variable as an Attribute Value
  • Create a Template to Format a Number
  • Create a Utility Style Sheet

After completing this module, students will be able to:

  • Leverage your procedural programming knowledge in XSLT, a nonprocedural language.
  • Understand how variables are created and used in XSLT style sheet.
  • Use the functions that are defined in the XSLT specification.
  • Create additional modular XSLT applications with the <xsl:include&rt; and <xsl:import&rt; elements.

Module 6: XML Result Tree Creation

This module explains how to use node-set and result tree fragment variables in a style sheet and how to use <xsl:copy&rt; and <xsl:copy-of&rt; elements. This module also explains when to use <xsl:element&rt; and <xsl:attribute&rt; instead of literal result elements.

Lessons

  • XML-Structured Variables
  • XML Node Creation Elements

Lab : XML Result Tree Creation

  • Overview
  • Create and Copy a Result Tree Fragment
  • Create and Use a Node-Set Variable
  • Create and Use an Attribute Set

After completing this module, students will be able to:

  • Use node-set and result tree fragment variables in a style sheet.
  • Use the <xsl:copy&rt; and <xsl:copy-of&rt; elements.
  • Understand when to use <xsl:element&rt; and <xsl:attribute&rt;.
  • Create comments and processing instructions.

Module 7: Calculate in XSLT

This module explains the concepts of recursive programming and how to summarize calculated values.

Lessons

  • Programming with No Side Effects
  • Apply Recursive Programming Techniques

Lab : Calculate in XSLT

  • Overview
  • Build a Comma-Delimited List

After completing this module, students will be able to:

  • Understand why XSLT variables don't vary.
  • Understand the concept of recursive programming.
  • Use recursive programming to parse a string and summarize calculated values.

Module 8: Common XSLT Challenges

This module explains how to apply the techniques learned in this course to common types of transformations, how to copy HTML tags from the data to the result, and how keys can speed up some transformations.

Lessons

  • Applying XSLT
  • How Do I Group Data?
  • Another Solution: Grouping Data
  • How Do I Copy HTML Tags from the Data?
  • How Do I Add or Remove Whitespace?

Lab : Common XSLT Challenges

  • Overview
  • Group Data Using a Node Set
  • Group Data Using a Key

After completing this module, students will be able to:

  • Apply the techniques in this course to common types of transformations.
  • Copy HTML tags from the data to the result.
  • Use two different techniques for grouping data.
  • Understand how keys can speed up some transformations.
  • Work with the generate-id() function.
  • Adjust the amount of whitespace in the results document.

Module 9: Use of Processor-Specific Extensions

This module explains how elements and functions are implemented by certain processors that are outside the W3C specification, and how code can recover if you use an extension and process the style sheet with a processor that doesn't recognize it.

Lessons

  • The Mechanics of Extensions
  • Should You Use Extensions?
  • Recovering from Missing Extensions

After completing this module, students will be able to:

  • Understand elements and functions implemented by certain processors that are outside the W3C specification.
  • Understand when to use extensions and when not to do so.
  • Understand how code can recover if you use an extension and process the style sheet with a processor that doesn't recognize it.

Before attending this course, students must have:

  • A good understanding of XML, including the concepts of elements and attributes.
  • Familiarity with HTML tags such as <body&rt;, <table&rt;, <h1&rt;, and <br&rt;.
  • Procedural programming experience (e.g., Visual Basic, Visual C++, and VBA) is helpful but not required.

Guaranteed to Run

2018-03-20 09:00 to 2018-03-23 17:00
Palm Beach County Florida (Instructor-Led)
2018-03-19 09:00 to 2018-03-23 17:00
Secaucus, New Jersey (Virtual Instructor-Led)
2018-03-01 09:00 to 2018-03-02 17:00
Palm Beach County Florida (Instructor-Led)

Course Reviews

No reviews found for this course.

Be the first to write a review