<xsl:transform> Element

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XSLT Reference

<xsl:transform> Element

The document element of a style sheet containing <xsl:template> and <msxsl:script> elements. Synonym for <xsl:stylesheet>.

<xsl:transform
  id = id 
  extension-element-prefixes = tokens 
  exclude-result-prefixes = tokens 
  version = number>
  <!-- Content: (xsl:import*, top-level-elements) -->
</xsl:transform> 

Attributes

id
A unique identifier that facilitates embedding style sheets.
extension-element-prefixes
The namespace to be used as an extension namespace. The value is a white-space-separated list of namespace prefixes. The namespace bound to each of the prefixes is designated as an extension namespace. The default namespace (as declared by xmlns) can be designated as an extension namespace by including #default in the list of namespace prefixes. The designation of a namespace as an extension namespace is effective within the subtree of the style sheet rooted at the element bearing the extension-element-prefixes; a subtree rooted at an <xsl:stylesheet> element does not include any style sheets imported or included by children of that <xsl:stylesheet> element.
exclude-result-prefixes
The namespace URI to be used as an excluded namespace. The value is a white-space-separated list of namespace prefixes. The namespace bound to each of the prefixes is designated as an excluded namespace. The default namespace (as declared by xmlns) may be designated as an excluded namespace by including #default in the list of namespace prefixes. The designation of a namespace as an excluded namespace is effective within the subtree of the style sheet rooted at the element bearing the exclude-result-prefixes; a subtree rooted at an <xsl:stylesheet> element does not include any style sheets imported or included by children of that <xsl:stylesheet> element.
version
Required. The version of XSLT that the XSLT file requires. The value should be set to "1.0" for this version of XSLT.

Element Information

Number of occurrences One
Parent elements (No parent elements)
Child elements xsl:attribute-set, xsl:import, xsl:include, xsl:output, xsl:param, xsl:template, xsl:variable, msxsl:script

Remarks

A synonym for the <xsl:stylesheet> element. This element can have a set of <xsl:template> elements representing different output templates. Processing begins by processing the root template, indicated by the pattern "/".

Example

This style sheet outputs a text string, and begins with <xsl:transform>, rather than <xsl:stylesheet>.

Note   To test this example in Internet Explorer, you need to use a script. For more information, see Initiate XSLT in a Script.

XML File (mymin.xml)

<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="helloxslt.xsl"?>
<myelem/>

XSLT File (helloxslt.xsl)

<?xml version='1.0'?>
<xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:template match="/">
   <html>
      <body><p>Hello from XSLT!</p></body>
   </html>
</xsl:template>

</xsl:transform>

Output

This is the formatted output:

Hello from XSLT!

This is the processor output:

<html>
<body><p>Hello from XSLT!</p></body>
</html>

See Also

<xsl:stylesheet> Element