Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

XSLT <xsl:namespace-alias> elements


May 28, 2021 XSL T


Table of contents


XSLT -lt;xsl: namespace-alias.gt; element

The XSLT-lt;xsl:namespace-alias-gt; element is used to replace the original namespace in the style sheet with a different namespace in the output.


XSLT <xsl:namespace-alias> elements Complete XSLT element reference manual

Definitions and usages

The namespace-alias element is used to replace the namespace in the style sheet with a different namespace in the output.

Note: slt;xsl:namespace-alias-gt; is a top-level element and must be a child node of slt;xsl:stylesheet>


Grammar

<xsl:namespace-alias
stylesheet-prefix="prefix|#default"
result-prefix="prefix|#default"/>

Property

属性 描述
stylesheet-prefix prefix
#default
必需。规定您希望更改的命名空间。
result-prefix prefix
#default
必需。为输出规定期望的命名空间。

Instance 1

The prefix wxsl is converted to the prefix xsl in the output:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wxsl="//www.w3cschool.cn/w3style.xsl">

<xsl:namespace-alias stylesheet-prefix="wxsl" result-prefix="xsl"/>

<xsl:template match="/">
<wxsl:stylesheet>
<xsl:apply-templates/>
</wxsl:stylesheet>
</xsl:template>

</xsl:stylesheet>

XSLT <xsl:namespace-alias> elements Complete XSLT element reference manual