Tutorial.06

Tutorial.06 - TUTORIAL 6 XP WORKING WITH XSLT AND XPATH New...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 6 1 XP TUTORIAL 6 WORKING WITH XSLT AND XPATH
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 6 2 XP In this chapter, you will: Learn about the history and theory of XSL Understand XPath and examine a node tree Create an XSLT style sheet Be introduced to syntax of the XPath language Transform an XML document into an HTML file Create templates to format sections of the XML document OBJECTIVES
Background image of page 2
New Perspectives on XML, 2 nd Edition Tutorial 6 3 XP OBJECTIVES In this chapter, you will: Sort the contents of an XML document Create conditional nodes to generate different HTML code Use predicates to select subsets of an XML document Insert new elements and attributes in the transformed document
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 6 4 XP THE HISTORY OF XSL In 1998, the W3C developed the Extensible Style sheet Language, or XSL XSL is composed of the following two parts: XSL-FO (Extensible Style sheet Language – Formatting Objects) XSLT (Extensible Style sheet Language Transformations)
Background image of page 4
New Perspectives on XML, 2 nd Edition Tutorial 6 5 XP INTRODUCING XSLT STYLE SHEETS AND PROCESSORS An XSLT style sheet contains instructions for transforming the contents of an XML document into another format An XSLT style sheet document is itself an XML document An XSLT style sheet document has an extension .xsl
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 6 6 XP GENERATING A RESULT DOCUMENT An XSLT style sheet converts a source document of XML content into a result document by using the XSLT processor
Background image of page 6
New Perspectives on XML, 2 nd Edition Tutorial 6 7 XP INTRODUCING XSLT STYLE SHEETS AND PROCESSORS The transformation can be performed by a server or a client In a server-side transformation, the server receives a request from a client, applies the style sheet to the source document, and returns the result document to the client In a client-side transformation, a client requests retrieval of both the source document and the style sheet from the server, then performs the transformation, and generates the result document
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 6 8 XP CREATING AN XSLT STYLE SHEET To create an XSLT style sheet, the general structure: <?xml version =“1.0”> <xsl:stylesheet version = “1.0” xmlns:xsl =“http://www.w3.org/1999/XSL/Transform”> Content of the style sheet </xsl:stylesheet> The <xsl:stylesheet> tag can be substituted for the <xsl:transform> tag
Background image of page 8
New Perspectives on XML, 2 nd Edition Tutorial 6 9 XP WORKING WITH DOCUMENT NODES Under XPath, each component in the document is referred to as a node, and the entire structure of the document is a node tree The node tree consists of the following objects: the source document itself comments processing instructions namespaces elements, element text element attributes
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2 nd Edition Tutorial 6 10 XP NODE TREE EXAMPLE
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/26/2010 for the course CS 178 taught by Professor Mandyam during the Spring '10 term at Ohlone.

Page1 / 51

Tutorial.06 - TUTORIAL 6 XP WORKING WITH XSLT AND XPATH New...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online