Subject: [xsl] Number of Recursive XSL Templates exceeded --> XML - Part 4 From: Sundararaman S A <sundararaman.sa@xxxxxxxxx> Date: Thu, 9 Dec 2004 13:53:40 +0530 |
********************************************************************* XSL FILE - PART 3 ******************************************************************** <xsl:template name="checkbox2"> <xsl:param name="name"/> <xsl:param name="value"/> <xsl:param name="form"/> <xsl:choose> <xsl:when test="string($value)=''"> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="0"/></xsl:attribute> </input> <input type="checkbox" name="checkbox1"/> </xsl:when> <xsl:when test="string($value)='0'"> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="0"/></xsl:attribute> </input> <input type="checkbox" name="checkbox1" onclick="{$form}.{$name}.value=1;"/> </xsl:when> <xsl:otherwise> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="1"/></xsl:attribute> <xsl:attribute name="onclick">submit()</xsl:attribute> </input> <input type="checkbox" name="checkbox1" checked="checked" onclick="{$form}.{$name}.value=0;"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!--start of value check box template--> <!-- Non Edit Box--> <xsl:variable name="SEPARATOR" select="'|'"/> <!--FS commands--> <xsl:template name="CxFSCommands"> <xsl:param name="session"/> <xsl:param name="objectid"/> <xsl:param name="positionToGo"/> <xsl:param name="filterposition"/> <xsl:param name="action"/> <xsl:param name="image"/> <xsl:param name="image2"/> <xsl:param name="process"/> <xsl:param name="type"/> <xsl:param name="return"/> <xsl:param name="stylesheet"/> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">sessionId</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="$session"/></xsl:attribute> </input> <xsl:if test="$filterposition"> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">filterposition</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="$filterposition"/></xsl:attribute> </input> </xsl:if> <xsl:if test="$positionToGo"> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">positionToGo</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="$positionToGo"/></xsl:attribute> </input> </xsl:if> <xsl:choose> <xsl:when test="$objectid"> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">id</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="$objectid"/></xsl:attribute> </input> </xsl:when> </xsl:choose> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">action</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="$action"/></xsl:attribute> </input> <xsl:choose> <xsl:when test="$type"> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">type</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="$type"/></xsl:attribute> </input> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="$process"> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">process</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="$process"/></xsl:attribute> </input> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="$return"> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">return</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="$return"/></xsl:attribute> </input> </xsl:when> </xsl:choose> <input> <xsl:attribute name="type">hidden</xsl:attribute> <xsl:attribute name="name">style</xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="concat($stylesheet,'.','xsl')"/></xsl:attribute> </input> <xsl:if test="$image"> <td colspan="2" align="right"> <input type="image" src="{$image}" style="cursor:hand"/> </td> </xsl:if> <xsl:if test="$image2"> <input type="image" src="{$image2}" style="cursor:hand"/> </xsl:if> </xsl:template> <!-- Header template for Fluid GUI --> <xsl:template name="header"> <xsl:param name="headerName"/> <table id="z" cellspacing="0" cellpadding="0" width="95%"> <tr> <td width="10" height="15"> <img src="{$images}dot.gif" width="10" height="1" alt="" border="0"/> </td> <td height="15" width="100%"> <img src="{$images}dot.gif" width="1" height="15" alt="" border="0"/> </td> </tr> <tr> <td> <img src="{$images}dot.gif" width="1" height="1" alt="" border="0"/> </td> <td> <table cellspacing="0" cellpadding="0" width="100%"> <tr> <td rowspan="2"> <img src="{$images}nav_border_shrt_alt.gif" width="10" height="21" border="0" alt=""/> </td> <td width="1" rowspan="2"> <img src="{$images}dot.gif" width="1" height="20" alt="" border="0"/> </td> <td> <table border="0" cellspacing="0" cellpadding="0" id="Data" width="100%"> <tr class="Detailsheader"> <td align="left"> <img src="{$images}dot.gif" width="10" height="1" alt="" border="0"/> </td> <td align="left" nowrap="nowrap"> <xsl:value-of select="$headerName"/> </td> <td> <img src="{$images}dot.gif" width="10" height="1" alt="" border="0"/> </td> </tr> </table> </td> <td width="1" rowspan="2"> <img src="{$images}dot.gif" width="1" height="20" alt="" border="0"/> </td> <td rowspan="2"> <img src="{$images}nav_border_shrt_alt.gif" width="10" height="21" border="0" alt=""/> </td> <td> <img src="{$images}dot.gif" width="1" height="19" alt="" border="0"/> </td> </tr> <tr> <td bgcolor="#CCCCCC"> <img src="{$images}dot.gif" width="1" height="1" alt="" border="0"/> </td> <td width="100%" height="1" bgcolor="#CCCCCC"> <img src="{$images}dot.gif" width="1" height="1" alt="" border="0"/> </td> </tr> </table> </td> </tr> </table> </xsl:template> <!-- Mandatory checking part --> <xsl:template name="mandatorycheck"> <xsl:param name="multiple"/> <script language="javascript"> var manElements = new Array(); /* Global array which will collect all mandatory elements */ var manDispElem = new Array();/* Global array which collects all displayable name of the field */ var manElementsCount = 0; /* Global counter to count number of mandatory elements */ function validate() { var manFiledCount = 0; /* Counter to count number of fieldNames */ var manFiledNames = new Array(); /* Array which collects the filed names from response.xml which are all have an attribute mandatory=true */ var manDisp=new Array(); /* Array which collects the displayable filed names from response.xml */ <xsl:variable name="idVal" select="@id"/> <xsl:for-each select="./descendant-or-self::*"> <xsl:choose> <xsl:when test="@mandatory='true'"> <xsl:choose> <xsl:when test="$multiple='false'"> manFiledNames[ manFiledCount ] = '<xsl:value-of select="name()"/>'; manDisp[ manFiledCount++ ] = '<xsl:value-of select="@displayname"/>'; </xsl:when> <xsl:otherwise> manFiledNames[ manFiledCount ] = '<xsl:value-of select="concat(name(..),'[',../@id,']','.',name())"/>'; manDisp[ manFiledCount++ ] = '<xsl:value-of select="@displayname"/>'; </xsl:otherwise> </xsl:choose> </xsl:when> </xsl:choose> </xsl:for-each> <xsl:text disable-output-escaping="yes"><![CDATA[ /* Following two for loops will pick out all the form inside all the elements in the document */ for(formCount =0; formCount<document.forms.length; formCount++) { formL = document.forms[formCount]; for( elementCount = 0;elementCount < formL.elements.length; elementCount++) { //alert(formL.elements[elementCount].name); validateElement(manFiledNames,manDisp,formL.elements[elementCount]); //Checks the element passed weather it is available in the field names array } } for(manElementsCount =0; manElementsCount < manElements.length; manElementsCount++) { if(manElements[manElementsCount].value=='') { //alert(manElements[manElementsCount].name+ ' is empty'); alert(manDispElem[manElementsCount]+ ' is empty'); manElements[manElementsCount].focus(); return false; } } return true; ]]></xsl:text> } <xsl:text disable-output-escaping="yes"><![CDATA[ /* If the received element name is availabe in "manFiledNames" array the paritcular element will be added in global array "manElements" */ function validateElement(manFiledNames,manDisp,manElement){ for( manFiledNamesCount= 0; manFiledNamesCount <manFiledNames.length; manFiledNamesCount++){ if( manFiledNames[manFiledNamesCount] == manElement.name ) { manElements[ manElementsCount ] = manElement; manDispElem[manElementsCount++]=manDisp[manFiledNamesCount]; } } }]]></xsl:text> </script> </xsl:template> <!-- Mandatory checking part End --> <!-- Header template for Fluid GUI --> <!-- Header sub template for Fluid GUI --> <xsl:template name="subheader"> <xsl:param name="headerName"/> <xsl:param name="headerstyle"/> <xsl:param name="headerid"/> <xsl:param name="session"/> <xsl:param name="start"/> <xsl:param name="displayname"/> <td align="left"> <img src="{$images}dot.gif" width="10" height="1" alt="" border="0"/> </td> <xsl:choose> <xsl:when test="$displayname=$headerName"> <!--<td align="left" nowrap="nowrap" > <xsl:value-of select="$headerName"/> </td> --> </xsl:when> <xsl:otherwise> <td align="left" nowrap="nowrap"> <a href="{$action}?action=read&sessionId={$session}&id={$headerid}&style={$headerstyle}"> <xsl:value-of select="$headerName"/> </a> </td> <td align="left"> <img src="{$images}dot.gif" width="10" height="1" alt="" border="0"/> </td> <td rowspan="2"> <img src="{$images}nav_border_shrt_alt.gif" width="10" height="21" border="0" alt=""/> </td> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- Header recursion template--> <xsl:template name="HeaderName"> <xsl:param name="displayname"/> <xsl:param name="headername"/> <xsl:param name="separator"/> <xsl:param name="headerid"/> <xsl:param name="headerstyle"/> <xsl:param name="session"/> <xsl:param name="start"/> <xsl:if test="$headername!=''"> <xsl:variable name="head"> <xsl:if test="contains($headername, $separator)"> <xsl:value-of select="substring-before($headername, $separator)"/> </xsl:if> <xsl:if test="not(contains($headername, $separator))"> <xsl:value-of select="$headername"/> </xsl:if> </xsl:variable> <xsl:variable name="headid"> <xsl:if test="contains($headerid, $separator)"> <xsl:value-of select="substring-before($headerid, $separator)"/> </xsl:if> <xsl:if test="not(contains($headerid, $separator))"> <xsl:value-of select="$headerid"/> </xsl:if> </xsl:variable> <xsl:variable name="headstyle"> <xsl:if test="contains($headerstyle, $separator)"> <xsl:value-of select="substring-before($headerstyle, $separator)"/> </xsl:if> <xsl:if test="not(contains($headerstyle, $separator))"> <xsl:value-of select="$headerstyle"/> </xsl:if> </xsl:variable> <xsl:call-template name="subheader"> <xsl:with-param name="headerName" select="$head"/> <xsl:with-param name="headerid" select="$headid"/> <xsl:with-param name="headerstyle" select="$headstyle"/> <xsl:with-param name="session" select="$session"/> <xsl:with-param name="start" select="$start"/> <xsl:with-param name="displayname" select="$displayname"/> </xsl:call-template> <xsl:call-template name="HeaderName"> <xsl:with-param name="headername" select="substring-after($headername, $separator)"/> <xsl:with-param name="separator" select="$separator"/> <xsl:with-param name="headerid" select="substring-after($headerid, $separator)"/> <xsl:with-param name="headerstyle" select="substring-after($headerstyle, $separator)"/> <xsl:with-param name="session" select="$session"/> <xsl:with-param name="displayname" select="$displayname"/> </xsl:call-template> <!-- --> </xsl:if> </xsl:template> <xsl:template name="ConcatOption"> <xsl:param name="value"/> <xsl:param name="domain"/> <!-- <xsl:param name="domain1"/>--> <xsl:param name="separator"/> <xsl:if test="$domain!=''"> <xsl:variable name="head"> <xsl:if test="contains($domain, $separator)"> <xsl:value-of select="substring-before($domain, $separator)"/> </xsl:if> <xsl:if test="not(contains($domain, $separator))"> <xsl:value-of select="$domain"/> </xsl:if> </xsl:variable> <option value="{$head}"> <xsl:if test="$head=$value"> <xsl:attribute name="selected"><xsl:value-of select="'selected'"/></xsl:attribute> </xsl:if> <xsl:value-of select="$head"/> </option> <xsl:call-template name="Option"> <xsl:with-param name="value" select="$value"/> <xsl:with-param name="domain" select="substring-after($domain, $separator)"/> <xsl:with-param name="separator" select="$separator"/> </xsl:call-template> </xsl:if> </xsl:template> <xsl:variable name="WEBROOT" select="'eins'"/> <xsl:variable name="FRAMES" select="'true'"/> <xsl:template match="sdmsearchfilterobject"> <xsl:param name="searchandclear"/> <xsl:choose> <xsl:when test="position() mod 2 = 1"> <xsl:text disable-output-escaping="yes"><![CDATA[<tr class="alternateRow2">]]></xsl:text> </xsl:when> <xsl:otherwise> <xsl:text disable-output-escaping="yes"><![CDATA[<tr class="alternateRow2">]]></xsl:text> </xsl:otherwise> </xsl:choose> <xsl:if test="hide != '1' "> <td width="20%"> <xsl:value-of select="displayname"/> </td> <td width="20%"> <xsl:for-each select="operatorlist"> <xsl:variable name="operatorlistname" select="concat('sdmsearchfilterobject[',../@id,']','.operatorlist')"/> <xsl:choose> <xsl:when test="string(.)!=''"> <xsl:choose> <xsl:when test="string($searchandclear)='0'"> <xsl:variable name="submitType"> <xsl:call-template name="FormSubmitTemplate"> <xsl:with-param name="frames" select="$FRAMES"/> <xsl:with-param name="frmobj" select="'window.document.filterDisplayTemplateForm'"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="selectboxwithnooption"> <xsl:with-param name="domain" select="@Domain"/> <xsl:with-param name="desc" select="@ValueDesc"/> <xsl:with-param name="funcname" select="$submitType"/> <xsl:with-param name="value" select="."/> <xsl:with-param name="name" select="$operatorlistname"/> <xsl:with-param name="displayselectedvalue" select="."/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="selectboxwithnooption"> <xsl:with-param name="domain" select="@Domain"/> <xsl:with-param name="desc" select="@ValueDesc"/> <xsl:with-param name="value" select="."/> <xsl:with-param name="name" select="$operatorlistname"/> <xsl:with-param name="displayselectedvalue" select="."/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="string($searchandclear)='0'"> <xsl:variable name="submitType"> <xsl:call-template name="FormSubmitTemplate"> <xsl:with-param name="frames" select="$FRAMES"/> <xsl:with-param name="frmobj" select="'window.document.filterDisplayTemplateForm'"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="selectboxwithnooption"> <xsl:with-param name="domain" select="@Domain"/> <xsl:with-param name="desc" select="@ValueDesc"/> <xsl:with-param name="funcname" select="$submitType"/> <xsl:with-param name="value" select="../defaultoperator"/> <xsl:with-param name="name" select="$operatorlistname"/> <xsl:with-param name="displayselectedvalue" select="../defaultoperator"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="selectboxwithnooption"> <xsl:with-param name="domain" select="@Domain"/> <xsl:with-param name="desc" select="@ValueDesc"/> <xsl:with-param name="value" select="../defaultoperator"/> <xsl:with-param name="name" select="$operatorlistname"/> <xsl:with-param name="displayselectedvalue" select="../defaultoperator"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:for-each> </td> <xsl:variable name="filterval" select="concat('sdmsearchfilterobject[',./@id,']','.filtervalue')"/> <xsl:choose> <xsl:when test="contains(string(filtervalue/@multivalue),'|')"> <xsl:variable name="lovs" select="filtervalue/@multivalue"/> <xsl:variable name="separator"> <xsl:value-of select="','"/> </xsl:variable> <xsl:variable name="separator2"> <xsl:value-of select="'|'"/> </xsl:variable> <xsl:variable name="separator3"> <xsl:value-of select="'|'"/> </xsl:variable> <xsl:variable name="lovsDomain"> <xsl:call-template name="findDomain"> <xsl:with-param name="lovs" select="$lovs"/> <xsl:with-param name="separator" select="$separator"/> <xsl:with-param name="separator2" select="$separator2"/> <xsl:with-param name="separator3" select="$separator3"/> </xsl:call-template> </xsl:variable> <xsl:variable name="lovsValue"> <xsl:call-template name="findValue"> <xsl:with-param name="lovs" select="$lovs"/> <xsl:with-param name="separator" select="$separator"/> <xsl:with-param name="separator2" select="$separator2"/> <xsl:with-param name="separator3" select="$separator3"/> </xsl:call-template> </xsl:variable> <xsl:variable name="ELVALUE"> <xsl:value-of select="filtervalue"/> </xsl:variable> <td> <xsl:text disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text> <xsl:choose> <xsl:when test="string($searchandclear)='0'"> <xsl:variable name="submitType"> <xsl:call-template name="FormSubmitTemplate"> <xsl:with-param name="frames" select="$FRAMES"/> <xsl:with-param name="frmobj" select="'window.document.filterDisplayTemplateForm'"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="selectbox"> <xsl:with-param name="domain" select="$lovsValue"/> <xsl:with-param name="desc" select="$lovsDomain"/> <!-- <xsl:with-param name="funcname" select="'return true'"/>--> <xsl:with-param name="funcname" select="$submitType"/> <xsl:with-param name="value" select="$ELVALUE"/> <xsl:with-param name="name" select="$filterval"/> <xsl:with-param name="displayselectedvalue" select="$ELVALUE"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="selectbox"> <xsl:with-param name="domain" select="$lovsValue"/> <xsl:with-param name="desc" select="$lovsDomain"/> <xsl:with-param name="funcname" select="'return true'"/> <xsl:with-param name="value" select="$ELVALUE"/> <xsl:with-param name="name" select="$filterval"/> <xsl:with-param name="displayselectedvalue" select="$ELVALUE"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </td> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="string(filtervalue)"> <xsl:variable name="val" select="filtervalue"/> <xsl:variable name="submitType"> <xsl:call-template name="FormSubmitTemplate"> <xsl:with-param name="frames" select="$FRAMES"/> <xsl:with-param name="frmobj" select="'window.document.filterDisplayTemplateForm'"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="string($searchandclear)='0'"> <td> <xsl:text disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text> <input type="text" value="{$val}" name="{$filterval}" onchange="{$submitType}"/> </td> </xsl:when> <xsl:otherwise> <td> <xsl:text disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text> <input type="text" value="{$val}" name="{$filterval}"/> </td> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="string(filtervalue)='' and string(defaultvalue)='???'"> <xsl:choose> <xsl:when test="string($searchandclear)='0'"> <xsl:variable name="val" select="filtervalue"/> <xsl:variable name="submitType"> <xsl:call-template name="FormSubmitTemplate"> <xsl:with-param name="frames" select="$FRAMES"/> <xsl:with-param name="frmobj" select="'window.document.filterDisplayTemplateForm'"/> </xsl:call-template> </xsl:variable> <td> <xsl:text disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text> <input type="text" value="" name="{$filterval}" onchange="{$submitType}"/> </td> </xsl:when> <xsl:otherwise> <td> <xsl:text disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text> <input type="text" value="" name="{$filterval}"/> </td> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:variable name="val" select="defaultvalue"/> <xsl:choose> <xsl:when test="string($searchandclear)='0'"> <xsl:variable name="val" select="filtervalue"/> <xsl:variable name="submitType"> <xsl:call-template name="FormSubmitTemplate"> <xsl:with-param name="frames" select="$FRAMES"/> <xsl:with-param name="frmobj" select="'window.document.filterDisplayTemplateForm'"/> </xsl:call-template> </xsl:variable> <td> <xsl:text disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text> <input type="text" value="{$val}" name="{$filterval}" onchange="{$submitType}"/> </td> </xsl:when> <xsl:otherwise> <td> <xsl:text disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text> <input type="text" value="{$val}" name="{$filterval}"/> </td> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> <xsl:text disable-output-escaping="yes"><![CDATA[</tr>]]></xsl:text> </xsl:if> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Number of Recursive XSL Templ, Sundararaman S A | Thread | [xsl] Number of Recursive XSL Templ, Sundararaman S A |
[xsl] Number of Recursive XSL Templ, Sundararaman S A | Date | [xsl] Number of Recursive XSL Templ, Sundararaman S A |
Month |