XSLT <XSL: namespace นามแฝง> องค์ประกอบ
ความหมายและการใช้งาน
<xsl: namespace นามแฝง> องค์ประกอบที่จะใช้ในการเปลี่ยนเอาท์พุท namespace สไตล์ชีทใน namespace ที่แตกต่างกัน
หมายเหตุ: <XSL: namespace นามแฝง> องค์ประกอบด้านบน (ระดับบนสุดองค์ประกอบ) และต้องเป็น <XSL: สไตล์ชีต> หรือ <XSL: เปลี่ยน> เด็กโหนด
ไวยากรณ์
<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 ธาตุอ้างอิงที่สมบูรณ์