XSLT <xsl: namespace-alias>
❮ Toàn bộ tham chiếu phần tử XSLT
Định nghĩa và Cách sử dụng
Phần tử <xsl: namespace-alias> được sử dụng để thay thế một không gian tên trong biểu định kiểu thành một không gian tên khác trong đầu ra.
Lưu ý: <xsl: namespace-alias> là một phần tử cấp cao nhất và phải là một nút con của <xsl: stylesheet> hoặc <xsl: converter>.
Cú pháp
<xsl:namespace-alias
stylesheet-prefix="prefix|#default"
result-prefix="prefix|#default"/>
Thuộc tính
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 |
ví dụ 1
Tiền tố wxsl được chuyển đổi thành tiền tố xsl trong đầu ra:
<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>
❮ Toàn bộ tham chiếu phần tử XSLT