XSLT <xsl:message>
❮ XSLT ဒြပ်စင် အကိုးအကားကို အပြီးသတ်ပါ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
<xsl:message> ဒြပ်စင်သည် အထွက်သို့ မက်ဆေ့ချ်တစ်ခု ရေးသည်။ အမှားအယွင်းများကို သတင်းပို့ရန် ဤအရာအား အဓိကအသုံးပြုသည်။
ဤဒြပ်စင်တွင် အခြားသော XSL ဒြပ်စင်များ (<xsl:text>၊ <xsl:value-of> စသည်ဖြင့်) နီးပါး ပါဝင်နိုင်သည်။
terminate attribute သည် အမှားအယွင်းတစ်ခုဖြစ်ပေါ်သောအခါမှ ထွက်ရန် သို့မဟုတ် လုပ်ငန်းစဉ်ကို ဆက်လက်လုပ်ဆောင်ရန် သင့်အား ရွေးချယ်ခွင့်ပေးသည်။
အထားအသို
<xsl:message terminate="yes|no">
<!-- Content:template -->
</xsl:message>
ဂုဏ်တော်
Attribute | Value | Description |
---|---|---|
terminate | yes no |
Optional. "yes" terminates the processing after the message is written to the output. "no" continues the processing after the message is written to the output. Default is "no". |
ဥပမာ ၁
အနုပညာရှင်သည် ကြိုးအလွတ်ရှိမရှိ စစ်ဆေးပါ။ ဟုတ်ပါက၊ ကျွန်ုပ်တို့သည် XSL ပရိုဆက်ဆာကို ဖြတ်ပြီး မက်ဆေ့ချ်ကို ပြသသည်-
<?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>
<xsl:for-each select="catalog/cd">
<p>Title: <xsl:value-of select="title"/><br />
Artist:
<xsl:if test="artist=''">
<xsl:message terminate="yes">
Error: Artist is an empty string!
</xsl:message>
</xsl:if>
<xsl:value-of select="artist"/>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
❮ XSLT ဒြပ်စင် အကိုးအကားကို အပြီးသတ်ပါ။