XSLT <xsl:namespace-alias>
❮ Kompletní reference prvků XSLT
Definice a použití
Element <xsl:namespace-alias> se používá k nahrazení jmenného prostoru v šabloně stylů za jiný jmenný prostor ve výstupu.
Poznámka: <xsl:namespace-alias> je prvek nejvyšší úrovně a musí být podřízeným uzlem <xsl:stylesheet> nebo <xsl:transform>.
Syntax
<xsl:namespace-alias
stylesheet-prefix="prefix|#default"
result-prefix="prefix|#default"/>
Atributy
Attribute | Value | Description |
---|---|---|
stylesheet-prefix | prefix #default |
Required. Specifies the namespace you wish to change |
result-prefix | prefix #default |
Required. Specifies the desired namespace for the output |
Příklad 1
Předpona wxsl je ve výstupu převedena na předponu xsl:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wxsl="https://www.w3schools.com/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>
❮ Kompletní reference prvků XSLT