XSLT <xsl: text>
❮ استكمال مرجع عنصر XSLT
التعريف والاستخدام
يُستخدم العنصر <xsl: text> لكتابة نص حرفي في الإخراج.
نصيحة: قد يحتوي هذا العنصر على نص حرفي ومراجع الكيانات و #PCDATA.
بناء الجملة
<xsl:text
disable-output-escaping="yes|no">
<!-- Content:#PCDATA -->
</xsl:text>
صفات
Attribute | Value | Description |
---|---|---|
disable-output-escaping | yes no |
Optional. "yes" indicates that special characters (like
"<") should be output as is. "no" indicates that special characters (like
"<") should be output as "<". Default is "no". This attribute is not supported by Netscape 6 |
مثال 1
يعرض عنوان كل قرص مضغوط. يُدرج "،" بين كل عنوان قرص مضغوط إذا لم يكن آخر قرص مضغوط - أو الأخير ولكن واحد. إذا كان هذا هو آخر قرص مضغوط ، فسيتم إضافة "!" خلف العنوان. إذا كان الأخير باستثناء واحد ، أضف "و" خلف العنوان:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<p>Titles:
<xsl:for-each select="catalog/cd">
<xsl:value-of select="title"/>
<xsl:if test="position() < last()-1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:if test="position()=last()-1">
<xsl:text>, and </xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text>!</xsl:text>
</xsl:if>
</xsl:for-each>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
❮ استكمال مرجع عنصر XSLT