Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XSLT Introduction

XSLT Introduction


XSLT is a language used to transform XML documents into XHTML documents or other XML documents.

XPath is a language used to navigate within XML documents.


Prerequisites You Need

Before you continue, you should have a basic understanding of the following:

If you want to learn these topics first, please visit ourHometo access these tutorials.


What is XSLT?


XSLT = XSL Transformation

XSLT is the most important part of XSL.

XSLT is used to transform one XML document into another XML document, or into another type of document recognized by a browser, such as HTML and XHTML. Usually, XSLT does this by transforming each XML element into an (X)HTML element.

With XSLT, you can add elements and attributes to the output file, or remove elements and attributes from it. You can also rearrange and sort elements, perform tests, and decide which elements to hide or show, and so on.

A common way to describe the transformation process is:XSLT transforms the XML source tree into an XML result tree。


XSLT Uses XPath

XSLT uses XPath to find information in XML documents. XPath is used to navigate within XML documents through elements and attributes.

If you want to learn XPath first, please visit our XPath Tutorial。


How does it work?

During the transformation, XSLT uses XPath to define the parts of the source document that match one or more predefined templates. Once a match is found, XSLT transforms the matching part of the source document into the result document.


XSLT is a W3C standard

XSLT became a W3C standard on November 16, 1999.

For more information about W3C's XSLT activities, please visit our W3C Tutorial。