XSLT <xsl:namespace-alias>要素
完全なXSLT要素リファレンス
定義と使い方
<xsl:namespace-alias> 要素は、スタイルシート内の名前空間を出力先の異なる名前空間に置き換えるために使用します。
注意:<xsl:namespace-alias> はトップレベル要素であり、<xsl:stylesheet> または <xsl:transform> の子ノードである必要があります。
構文
<xsl:namespace-alias
stylesheet-prefix="prefix|#default"
result-prefix="prefix|#default"/>
stylesheet-prefix="prefix|#default"
result-prefix="prefix|#default"/>
属性
| 属性 | 值 | 説明 |
|---|---|---|
| stylesheet-prefix | prefix #default |
必須です。変更したい名前空間を指定します。 |
| result-prefix | prefix #default |
必須です。出力用の希望する名前空間を指定します。 |
例 1
接頭辞 wxsl は出力では接頭辞 xsl に変換されます:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wxsl="http://www.w3cschool.cc/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>
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wxsl="http://www.w3cschool.cc/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要素リファレンス その他の拡張機能