Our requirement was to recognize the preview or generate mode in XSL.Hence we stored the value of '$CONTEXT{preview}' in a variable and tried to access its value When we printed the value of the "isPreview" variable , it gave an output of true or false depending on the mode(preview or generate). However when we tried to access the same using a conditional statement (<xsl:if>,<xsl:when>,) , it would not execute.We tried to analyze this and we strangely found that the length of the variable was 17. We tried to get the contents of the variable and stangely "$CONTEXT{preview]" was part of it. However on printing the variable , it gave us only true or false. If anyone has faced this issue before or has any insights on the same , Kindly let us know.