XSLT <xsl:namespace-bí danh>
❮ Tham chiếu phần tử XSLT đầy đủ
Định nghĩa và cách sử dụng
Phần tử <xsl:namespace-alias> được sử dụng để thay thế một vùng tên trong biểu định kiểu thành một vùng tên khác ở đầu ra.
Lưu ý: <xsl:namespace-alias> là phần tử cấp cao nhất và phải là nút con của <xsl:stylesheet> hoặc <xsl:transform>.
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 ở đầu ra:
<xsl:stylesheet version="1.0"
xmlns:xsl="https://www.w3.org/1999/XSL/Transform"
xmlns:wxsl="https://www.example.com.vn/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>
❮ Tham chiếu phần tử XSLT đầy đủ