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"/>
คุณลักษณะ
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 |
ตัวอย่าง 1
คำนำหน้า wxsl ถูกแปลงเป็นคำนำหน้า 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>
❮ ทำการอ้างอิงองค์ประกอบ XSLT ให้สมบูรณ์