Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML
IMCreator - Free Website Builder

XSLT Syntax

All XSLT documents need to be well-formed and valid XML documents, so you need to follow the same syntax rules that apply to any other XML document.

As well as ensuring that your XSLT documents are valid XML, you need to ensure they are valid XSLT documents. Here's what you need to remember when creating XSLT documents.

XML Version

XSL documents are also XML documents and so we should include the XML version in the document's prolog. We should also set the standalone attribute to "no" as we now rely on an external resource (i.e. the external XSL file).

Code

XSL Root Element

Then we open the root element - xsl:stylesheet. The root element needs to include the XSL version as well as the XSL namespace (hence the xsl prefix and the xmlns... part).

Code

XSL Namespace Prefix

All XSL elements in your XSLT document must include the XSL prefix.

Syntax:

Code

Example:

Code

Enjoy this page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!