Download XML.com: What Is XSLT
Transcript
·1.1.7 Stylesheet association •1.2 Transformation data flows ·1.2.1 Transformation from XML to XML ·1.2.2 Transformation from XML to XSL formatting semantics ·1.2.3 Transformation from XML to non-XML ·1.2.4 Three-tiered architectures 2. Getting started with XSLT and XPath •2.1 Stylesheet examples ·2.1.1 Some simple examples ·2.1.2 Some more complex examples •2.2 Syntax basics - stylesheets, templates, instructions ·2.2.1 Explicitly declared stylesheets ·2.2.2 Implicitly declared stylesheets ·2.2.3 Stylesheet requirements ·2.2.4 Instructions and literal result elements ·2.2.5 Templates and template rules ·2.2.6 Approaches to stylesheet design 1. The Context of XSL Transformations and the XML Path Language This first chapter examines the context of two W3C Recommendations -- Extensible Stylesheet Language Transformations (XSLT) and XML Path Language (XPath) -- within the growing family of Recommendations related to the Extensible Markup Language (XML). Later we will look at detailed examples, but first let's focus on XSLT and XPath in the context of a few of the Recommendations in the XML family and examine how these two Recommendations work together to address separate and distinct functionality required when working with structured information technologies. This chapter does not attempt to address all of the numerous XML-related Recommendations currently released or in development. Specifically, we will be looking at only the following as they relate to XSLT and XPath: Extensible Markup Language (XML) For years, applications and vendors have imposed their constraints on the way we can represent our information. Our data has been created, maintained, stored and archived according to the rules enforced by others. The advent of the Extensible Markup Language (XML) moves the control of our information out of the hands of others and into our own by providing two basic facilities. XML describes rules for structuring our information using embedded markup of our own choice. We can take control of our information representation by creating and using a vocabulary we design of elements and attributes that makes sense for the way we do our business and use our data. In addition, XML describes a language for formally declaring the vocabularies we use. This allows our tools to constrain the creation of an instance of our information, and allows our users to validate a properly created instance of information against our set of constraints. Note 1: An XML document is just an instance of well-formed XML. The two terms document and instance could be used interchangeably, but this reference material uses the term instance to help readers remember that XML isn't just for documents or documentation. With XML we describe a related set of information in a tree-like hierarchical fashion, and gain the benefits of having done so, whether the information captures an invoice-related transaction between computers, or the content of a user manual rendered on paper. XML Path Language (XPath) XPath is a string syntax for building addresses to the information found in an XML document. We use this language to specify the locations of document structures or data found in an XML document when processing that information using XSLT. XPath allows us from any location to address any other location or content. Extensible Stylesheet Language Family (XSLT/XSL) Two vocabularies specified in separate W3C Recommendations provide for the two distinct styling processes of transforming and rendering XML instances. We can transform information using one vocabulary into an alternate form by using the Extensible Stylesheet Related Reading