Namespace Prefix Declarations

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XSLT Developer's Guide

Namespace Prefix Declarations

An XSLT style sheet must have at least one namespace declaration as an attribute of the <xsl:stylesheet> element. For MSXML versions 4.0 and later, this is <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">. This particular namespace declaration (i.e., xsl) is required for all the XSLT-defined elements, including the <xsl:stylesheet> element itself. Additional namespace prefixes can also be added. For example, to use the MSXML custom extension element, <msxsl:script>, you must add a namespace declaration for the msxsl prefix, as follows:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt">

The default namespace has no prefix and is usually used for literal result elements in a template rule. The following is an example of a literal result element:

<DIV>XSLT Output<DIV>

See Also

Using Namespaces in Documents (XML Developer's Guide) | Declaring Namespaces for XSLT | Working with Namespaces and Prefix Aliases | Declaring the msxsl: Namespace Prefix