<xsl:namespace-alias> Element

The <xsl:namespace-alias> element replaces the prefix associated with a given namespace with another prefix.

  stylesheet-prefix = NCName 
  result-prefix = NCName/>

The prefix for the namespace URI used in the XSLT file.

The prefix for the namespace URI used in the result tree.


Number of occurrences


Parent elements


Child elements

(No child elements)

Sometimes the content that an XSLT file generates is other XSLT. This presents a challenge with namespaces because there is no explicit way to declare two prefixes with the same namespace without the processor treating both prefixes as the same namespace and acting on them. With the <xsl:namespace-alias> command, you canassign an interim namespace to an alternate prefix, apply the style sheet, and then map the alternate namespace to the XSLT one.

Although XSL-to-XSL file generation is the primary use for this command, it is not the only one. You can use this technique anywhere you have colliding namespaces (for example, with the xsi: schema data type namespace). The top-level element must be <xsl:namespace-alias>.

The following topic example provides an example of <xsl:namespace-alias>.

Build Date: