Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

<xsl:namespace-alias> Element

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

<xsl:namespace-alias
  stylesheet-prefix = NCName 
  result-prefix = NCName/>
stylesheet-prefix
The prefix for the namespace URI used in the XSLT file.

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

 

Number of occurrences

Unlimited

Parent elements

xsl:stylesheet

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:

2012-08-02
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.