xml - Greater than(>) and less than(<) operator not working in XSLT -


below xsl trying check condition if size of file greater preset value , try stop processing, looks condition not getting executed. not sure if not formatted right way. can in , see if there issue?

value of both variable incomingfilesize , setfilesize of type 'number'

<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:dp="http://www.datapower.com/extensions" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dpconfig="http://www.datapower.com/param/config" extension-element-prefixes="dp" exclude-result-prefixes="dp dpconfig inc"> <xsl:template match="/">     <xsl:variable name="file_cd" select="document('local:///fileintake/resources/fileserviceconfigdata.xml')"/>     <xsl:variable name="incomingfilesize" select="number(dp:variable('var://service/mpgw/request-size'))"/>     <!-- <xsl:variable name="setfilesize" select="$file_cd/fileserviceconfig/filesize"/> -->     <xsl:variable name="setfilesize" select="number($file_cd/fileserviceconfig/filesize)"/>     <dp:set-variable name="'var://context/var/incomingfilesize'" value="$incomingfilesize"/>     <dp:set-variable name="'var://context/var/setfilesize'" value="$setfilesize"/>     <xsl:choose>         <xsl:when test="'$incomingfilesize '&gt;' $setfilesize'">             <dp:reject/>         </xsl:when>         <xsl:otherwise>             <dp:accept/>         </xsl:otherwise>     </xsl:choose> </xsl:template> 

i figured out went wrong. below correct way write condition. had put unnecessary single quotes.

<xsl:when test="$incomingfilesize &gt; $setfilesize"> 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -