Add Site or Add Page to Favorites
> 

 XSLT Style Sheets 

Clarify the meaning of the acronyms on your web site.

Acronym Dictionary

Acronym Finder

Get information on your favorite TV Shows at TV Series .com

Social Networking Web Sites


Printer-friendly PDF* format:

HTML 5 Tutorial

XSLT Style Sheets (AKA Templates) in HTML

An XSLT style sheet provides a template that can be reused for multiple pages of a site. Using XSLT style sheets for the common elements (the "look and feel") of a web site can improve web page load times, since the templates can be cached by most browsers.

An XSLT style sheet can be applied to a web page by including a link tag with a MIME type specification of "application/xslt+xml". For backward compatibility with older browsers, it's probably a good idea to include a reference to the primary style sheet in a stylesheet processing instruction with the MIME type text/xsl.

Here is an example of an HTML page using both an XSLT style sheet and CSS:

                        <?xml version="1.0" encoding="UTF-8"?>
                        
<?xml-stylesheet type="text/xsl" href="/site-template.xsl"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="application/xslt+xml" href="/styles/print.xsl" media="print"/>
<link rel="stylesheet" type="application/xslt+xml" href="/styles/handheld.xsl" media="handheld"/>
<link rel="stylesheet" type="application/xslt+xml" href="/styles/screen.xsl" media="screen"/>
<link rel="stylesheet" type="text/css" media="print" href="/styles/print.css"/>
<link rel="stylesheet" type="text/css" media="handheld" href="/styles/handheld.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="/styles/screen.css"/>
<title>Example Only</title>
</head>
<body>
<h1>Sample HTML 5 Web Page with Style Sheets</h1>
<p>This is the content of the page. The appropriate CSS styles will be applied</p>
The styles from the appropriate .css file will be applied to various elements on the page and
the "look and feel" in the templates in the appropriate .xsl file will be wrapped around it.
</p>
</body>
</html>

The style sheets are ordered from lowest priority to highest (print, handheld, screen) just in case the browser ignores the media attribute of the link tag.

Last updated Sunday September 19, 2010

You are currently viewing this page in HTML 4* format (* see Clicklets for more infomation). This document is also available in XHTML 1 Style Sheet*XHTML 1* XML*HTML 5 Style Sheet*HTML 5 XML*HTML 5 non-XML* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.


Copyright © 2010 Accilent® Corp. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.

DISCLAIMER: All information, links, forms, applications and other items on this site or obtained from it are provided AS IS, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.