Question

i have this block of xslt if-else case and was wondering if there's a way for me to do straight comparison with unicode character?

Something along the lines of the code shown below? Or does xslt have some built in function which i can use for this purpose? i.e. change the unicode into html entities and compare via that method?

Of course if there's a better way please fire away. Thanks.

<xsl:choose>
                        <xsl:when test="status">
                            <xsl:if test="status='تم المحاولة'">
                                <font color="#00CC00"><xsl:value-of select="status" /></font><br/>
                <!--a href="/Elearning_Platform/xfiles/reports/view_reports.modcgi?asm_lid={@lom_id}&amp;did={@dispatch_id}&amp;rm_student_id={@person_id}&amp;report_type=2">[View Results]</a-->
                            </xsl:if>
</xsl:when>
                        <xsl:otherwise>
                            &nbsp;
                        </xsl:otherwise>
                    </xsl:choose>
Was it helpful?

Solution

If both the source XML and the XSLT are declared as UTF-8 encoded i believe this shouldnt be a problem. If your parser supports EXSLT you can call url-decode(status) directly this resource has some examples + makes a good read about encoding in XSLT in general.

OTHER TIPS

The answer is positive.

More precisely, any character that can be used within an XML document, can be used as part of an argument to an XPath equality comparison operator.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top