XSLT <xsl:namespace-alias>
❮ Pełne odniesienie do elementu XSLT
Definicja i użycie
Element <xsl:namespace-alias> służy do zastąpienia przestrzeni nazw w arkuszu stylów inną przestrzenią nazw w danych wyjściowych.
Uwaga: <xsl:namespace-alias> jest elementem najwyższego poziomu i musi być węzłem podrzędnym <xsl:stylesheet> lub <xsl:transform>.
Składnia
<xsl:namespace-alias
stylesheet-prefix="prefix|#default"
result-prefix="prefix|#default"/>
Atrybuty
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 |
Przykład 1
Prefiks wxsl jest konwertowany na prefiks xsl w danych wyjściowych:
<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>
❮ Pełne odniesienie do elementu XSLT