Solved

Invalid instantiation of 'xsl:value' in 'table' context

Posted on 2004-08-24
2
1,147 Views
Last Modified: 2008-03-10
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="houseOrigin" select="page/SECOND/ROWSET/ROW/OT"/>
<xsl:param name="recordsPerPage" select="10" />
<xsl:variable name="Operation" select="page/request/parameters/Operation1"/>
<xsl:variable name="houseLength" select="page/request/parameters/houseLength1"/>
<xsl:param name="pageNumber" select="page/request/parameters/pageNumber" />
<xsl:param name="recordCount" select="count(//SECOND/ROWSET/ROW)" />
<xsl:key name="housedocIds" match="FIRST/ROWSET/ROW" use="ID"/>
<xsl:output method="html" />
<xsl:template match="page">
<link rel="stylesheet" href="eagle.css"/>
<script>
 var len = "<xsl:value-of select='$houseLength'/>"

<![CDATA[

function setValues()
 {

      var houseLength=len;
      

      onload_flag="T";
      for(var i=0;i<houseLength;i++)
            setHouseChecked(i,houseLength);
      onload_flag="F";
 }



function setHouseChecked(index,houseLength)
{

      if(houseLength >= 1)
      {

      alert(document.forms[0].houseDocId[index].value+"...index.."+index+"....."+document.forms[0].houseCheck[index].checked)
            if(document.forms[0].houseCheck[index].checked == true)
            {
                  checkedCount++;
                  document.forms[0].houseStatus[index].value      =       "checked"

            }
            else
            {
                  if(onload_flag=="F")
                  {
                        checkedCount--;
                        document.forms[0].houseStatus[index].value      =       "";

                  }
            }
        
      }
      else
      {

      if(document.forms[0].houseCheck)
       {
            alert(document.forms[0].houseCheck.checked)
            if(document.forms[0].houseCheck.checked == true)
            {
                  checkedCount++;
                  document.forms[0].houseStatus.value                  =       "checked"
            }
            else
            {
                  if(onload_flag=="F")
                  {
                        checkedCount--;
                        document.forms[0].houseStatus.value                  =       "";
                  }
            }
            
        }
      }
      
      if(checkedCount < 0)
            checkedCount = 0;

                  
}

function checkAll(houseLength)
{
      checkedCount = 0;
      if(houseLength > 0)
      {
            if(houseLength > 1)
            {
                  if(document.forms[0].houseCheckAll.checked == true)
                  {
                        for(var i=0;i<houseLength;i++)
                        {
                              if(document.forms[0].houseCheck[i].value =='I' && (document.forms[0].bbStatus[i].value=='O' || document.forms[0].bbStatus[i].value=='P' || document.forms[0].bbStatus[i].value=='N') )
                              {
                                    document.forms[0].houseStatus[i].value      = ""
                                    continue;
                              }
                              if(document.forms[0].houseCheck[i].checked == false)
                              {
                                    document.forms[0].houseCheck[i].checked      = true;
                                    document.forms[0].houseStatus[i].value      = "checked"
                                    setHouseChecked(i,houseLength)
                              }
                              else
                                    checkedCount++;
                        }            
                  }
                  else
                  {
                        for(var i=0;i<houseLength;i++)
                        {
                              document.forms[0].houseCheck[i].checked      = false;
                              document.forms[0].houseStatus[i].value      = ""
                              setHouseChecked(i,houseLength)
                        }      
                  }
            }
            else
            {
                  if(document.forms[0].houseCheck.value =='I' && (document.forms[0].bbStatus.value=='O' || document.forms[0].bbStatus.value=='P' || document.forms[0].bbStatus.value=='N') )
                  {
                        document.forms[0].houseStatus.value      = ""
                        return;
                  }
                  if(document.forms[0].houseCheckAll.checked == true && document.forms[0].houseCheck.checked      == false)
                  {
                        document.forms[0].houseCheck.checked      = true;
                        document.forms[0].houseStatus.value            = "checked";
                        setHouseChecked('0',houseLength);
                  }
                  else if(document.forms[0].houseCheckAll.checked == false && document.forms[0].houseCheck.checked      == true)
                  {
                              document.forms[0].houseCheck.checked      = false;
                              document.forms[0].houseStatus.value      = ""
                              setHouseChecked('0',houseLength)
                  }
            }
      }
}

function showHouseDetails(houseDocId)
{
  var      Operation        =      '<%=operation%>';
  var      subOperation=      'FromEnterId';
  var      ShipmentMode=      '<%=shipmentMode%>';
  var      terminalId      =      '<%=terminalId%>';
  var      terminalType=      '<%=terminalType!=null?terminalType:""%>';

      var      windowFeatures      =      "directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizable=yes";      
      Url      =      'ETAHouseDocumentController?houseDocId='+houseDocId
                                                      +'&Operation=houseView'
                                                      +'&subOperation=FromId'
                                                      +'&ShipmentMode='+ShipmentMode
                                                      +'&terminalType='+terminalType
                                                      +'&terminalId='+terminalId

  var repWin = open(Url, "reportWindow", windowFeatures);
  repWin.focus();      
}

function getCheckedResults(Len)
{
            var isPrintedChecked = false;
            var isSubmit = true;

            if(Len  > 1)
                  {
                        for(var i=0;i<10;i++)
                        {

                              if(document.forms[0].housePrintFlag[i].value!='Y' && document.forms[0].houseCheck[i].checked)
                                    {
                                    
                                    
                                                isPrintedChecked = true;
                                                break;
                                    }
                        }
                  }
                  else
                        {
                          if(document.forms[0].housePrintFlag)
                              {
                              if(document.forms[0].housePrintFlag.value!='Y' && document.forms[0].houseCheck.checked)
                                    {
                                                isPrintedChecked = true;
                                    }
                           }
                        }
            
            if(isPrintedChecked)
          {
                   var where_to= confirm("Some of the selected shipments are not printed Do you want to Continue");
                   if (!where_to)
                   {
                         isSubmit = false;
                   }
            }
            
            if(isSubmit)
              {
                        Url      =      'ETAMasterDocumentController?subOperation=CheckedAirResults';
                        document.forms[0].action = Url;
                        disableForm(new Array("Search","Submit"));
                        document.forms[0].submit();
            }

          return isSubmit;
}

]]>

</script>
<script language="javascript" src="html/eSupply.js"/>

       <table  width="820" cellpadding="2" cellspacing="1" border="0">
            <tr > 
            <td class="subHeader">HAWB Information:::<xsl:value-of select="count(//FIRST/ROWSET/ROW)"/>
                  </td>
                  <td class="subHeader" align='right'>
                  <font color='red' size='1'>
                        * Red - Shipments that have oversize dimensions of 125 x 80 x 60 Inches </font>
                  </td>
        </tr>
            </table>
          <table width="820" border="0" cellspacing="1" cellpadding="2">
           <tr class='formheader'>
            <td width="95" align='center' id="td1">HAWB No</td>
            <td width="50" align='center' id="td2"> Origin</td>
            <td width="84" align='center' id="td3">Destination</td>
            <td width="89" align='center' id="td4">Shipper</td>
            <td width="80" align='center' id="td5" >Consignee</td>
            <td   align='center' id="td6">Priority</td>
            <td   align='center' id="td7">Pieces</td>
            <td   align='center' id="td8">Gross Wt.</td>
            <td  align='center'  id="td9">Chargeable Wt.</td>
            <td  align='center' id="td10">Volume.</td>
            <td  align='center' id="td11">Volumetric Wt.</td>
            <td  align='center' id="td12">DueDate.</td>
          </tr>
      </table>
<xsl:call-template name="firstone">
      <xsl:with-param name="limit" select="count(//FIRST/ROWSET/ROW)"/>
      <xsl:with-param name="ctr" select="0"/>
 </xsl:call-template>

<xsl:call-template name="secondone"/>
</xsl:template>


<xsl:template name="firstone">
<xsl:param name="limit"/>
<xsl:param name="ctr"/>
<xsl:for-each select ="FIRST/ROWSET/ROW">
<table width="820" border="0" cellspacing="1" cellpadding="2">
counte11r:<xsl:value select="$ctr"/>
  <xsl:if test = "$ctr &lt; $limit">
<tr>
              <td align="center">
          <input type="checkbox" id="houseCheck{$ctr}"  name="houseCheck" value='{ST}'>
      <xsl:attribute name="onClick">
          setHouseChecked(<xsl:value-of select="$ctr"/>,<xsl:value-of select="count(//FIRST/ROWSET/ROW)"/>)
      </xsl:attribute>
      <xsl:attribute name="{ST}"/>
      </input>

      <input type="hidden" id="houseStatus{$ctr}" name="houseStatus" value="{ST}">
      </input>

      <input type="hidden" id="hawbHistoryStatus{$ctr}" name="hawbHistoryStatus" value="{ST}"/>
      </td>
            <td  width="95" >
            <xsl:choose>
            <xsl:when test ="HZD= 'Y'">
            <img src="images/hazardous.gif" />
            </xsl:when>
            <xsl:otherwise>
            &nbsp;&nbsp;&nbsp;
            </xsl:otherwise>
            </xsl:choose>
            <a>
            <xsl:attribute name="href">javascript:showHouseDetails('<xsl:value-of select="ID"/>')</xsl:attribute><xsl:value-of select="ID"/>
            </a>
      <xsl:choose>
      <xsl:when test="HOUSE_TYPE ='MHAWB' and PF = 'Y' and SYS_FLAG ='Y'">
         <font size='1' color='red'>[<font size='1' color='blue'>M</font>,<font size='1' color='green'>P</font>]</font>
         </xsl:when>
      <xsl:when test="HOUSE_TYPE ='MHAWB'">
         <font size='1' color='red'>[<font size='1' color='blue'>M</font>]</font>
         </xsl:when>
      <xsl:when test="PF = 'Y' and SYS_FLAG ='Y'">
        <font size='1' color='red'>[<font size='1' color='green'>P</font>]</font>
         </xsl:when>
      <xsl:otherwise></xsl:otherwise>
      </xsl:choose>

      <input type="hidden" id="houseDocId{position()}" name="houseDocId" value="{ID}"/>
      </td>
      <td  align="center" width="50" >
      <xsl:value-of select="OT"/>
      <input type="hidden" name="houseOriginTerminal"  value="{OT}"/>
      </td>
      <td  align="center" width="84" ><xsl:value-of select="DT"/>
      <input type="hidden" name="houseDestTerminal"  value="{DT}"/>
      </td>
      <td  align="center" width="89" ><xsl:value-of select="SNAME"/>
      <input type="hidden" name="houseShipperId"  value="{SHID}"/>
      <input type="hidden" name="houseShipperName" value='{SNAME}'/>
      </td>
      <td  align="center" width="80" ><xsl:value-of select="CGNAME"/>
      <input type="hidden" name="houseConsigneeId"  value="{CHID}"/>
      <input type="hidden" name="houseConsigneeName" value='{CGNAME}'/>
      </td >

       <td   align="center" ><xsl:value-of select="SL"/>
      <input type="hidden" name="houseServiceLevelId" value='{SL}'/>                        
      <input type="hidden" name="houseServiceType" value='{PM}'/>                
      </td>
      <td   align="center" ><xsl:value-of select="PCS"/>
      <input type="hidden" name="houseTotalPieces" value='{PCS}'/>                        
      </td>
      <td  align="center" ><xsl:value-of select="GW"/>
      <input type="hidden" name="houseGrossWeight" value='{GW}'/>                        
      </td>
      <td  align="center" ><xsl:value-of select="CW"/>
      <font color='Green' size='1'>&nbsp;</font>
      <input type="hidden" name="houseChargeableWeight" value='{CW}'/>
      <input type="hidden" name="houseUOW" value='{UOW}'/>
      <input type="hidden" name="houseHazardousFlag" value='{HZD}'/>
      </td>
      <td  align="center" ><xsl:value-of select="VL"/><font color='Green' size='1'>&nbsp;<xsl:value-of select="VLUM"/></font>
      <input type="hidden" name="houseUOV" value='{VLUM}'/>       
       <input type="hidden" name="houseVolume" value='{VL}'/>
      </td>
      <td  align="center" ><xsl:value-of select="VOLUMETRIC_WT"/>
      <input type="hidden" name="houseVolumetric" value='{VOLUMETRIC_WT}'/>
      <input type="hidden" name="housedimFactor" value='{DFTR}'/>
      </td>
      <td  align="center" >&nbsp;<xsl:value-of select="duedate"/>
       <input type="hidden" name="houseDueDate" value=''/>
       <input type="hidden" name="houseDueTime" value=''/>
      <input type="hidden" name="houseUOMFlag" value='No'/>       
      <input type="hidden" name="isDomestic" id="isDomestic{position()}" value='{LEG_TYPE}'/>       
      <input type="hidden" name="bbStatus" id="bbStatus{position()}" value='{BB_STATUS}'/>
      <input type="hidden" name="hawbNo" id="hawbNo{position()}" value='{SNO}'/>
      <input type="hidden" name="routePlanId" id="routePlanId{position()}"  value='{RTID}'/>
      <input type="hidden" name="houseRoutePlanId" id="houseRoutePlanId{position()}"  value='{RTID}'/>
      <input type="hidden" name="hawbSeqNo" id="hawbSeqNo{position()}"   value='{SNO}'/>
      <input type="hidden" name="shipmentStatus" id="shipmentStatus{position()}"  value='{SS}'/>
      <input type="hidden" name="isAttachable" id="isAttachable{position()}"  value='YES'/>
      <input type="hidden" name="housePrintFlag"  id="housePrintFlag{position()}"  value='{PF}'/>
      <input type='hidden' name="houseSystemFlag" id="houseSystemFlag{position()}" value="{SYS_FLAG}"/>
      <input type='hidden' name="hawbFlag"  id="hawbFlag{position()}"  value="{HOUSE_TYPE}"/>
       </td>
      </tr>
      </xsl:if>
          </table>
    <xsl:call-template name="firstone">
      <xsl:with-param name="limit" select="$limit"/>
      <xsl:with-param name="ctr" select="$ctr + 1"/>
    </xsl:call-template>
      </xsl:for-each>
      
</xsl:template>



<xsl:template name="secondone">
<xsl:for-each select ="SECOND/ROWSET/ROW">
<xsl:if test="position() &gt;  $recordsPerPage * number($pageNumber) and position() &lt;= number($recordsPerPage * number($pageNumber) +
            $recordsPerPage)">
<table width="820" border="0" cellspacing="1" cellpadding="2">
<tr>
              <td align="center">
      <input type="checkbox" id="houseCheck{position()}"  name="houseCheck" value='{ST}'>
      <xsl:attribute name="onClick">
          setHouseChecked(<xsl:value-of select="position()"/>,<xsl:value-of select="count(//SECOND/ROWSET/ROW)"/>)
      </xsl:attribute>
      <xsl:attribute name="{ST}"/>
      </input>

      <input type="hidden" id="houseStatus{position()}" name="houseStatus">
      <xsl:attribute name="value">
      </xsl:attribute>
      </input>

      <input type="hidden" id="hawbHistoryStatus{position()}" name="hawbHistoryStatus" value="{ST}"/>
      </td>
            <td  width="95" >
            <xsl:choose>
            <xsl:when test ="HZD= 'Y'">
            <img src="images/hazardous.gif" />
            </xsl:when>
            <xsl:otherwise>
            &nbsp;&nbsp;&nbsp;
            </xsl:otherwise>
            </xsl:choose>
            <a>
            <xsl:attribute name="href">javascript:showHouseDetails('<xsl:value-of select="ID"/>')</xsl:attribute><xsl:value-of select="ID"/>
            </a>
      <xsl:choose>
      <xsl:when test="HOUSE_TYPE ='MHAWB' and PF = 'Y' and SYS_FLAG ='Y'">
         <font size='1' color='red'>[<font size='1' color='blue'>M</font>,<font size='1' color='green'>P</font>]</font>
         </xsl:when>
      <xsl:when test="HOUSE_TYPE ='MHAWB'">
         <font size='1' color='red'>[<font size='1' color='blue'>M</font>]</font>
         </xsl:when>
      <xsl:when test="PF = 'Y' and SYS_FLAG ='Y'">
        <font size='1' color='red'>[<font size='1' color='green'>P</font>]</font>
         </xsl:when>
      <xsl:otherwise></xsl:otherwise>
      </xsl:choose>

      <input type="hidden" id="houseDocId{position()}" name="houseDocId" value="{ID}"/>
      </td>
      <td  align="center" width="50" >
      <xsl:value-of select="OT"/>
      <input type="hidden" name="houseOriginTerminal"  value="{OT}"/>
      </td>
      <td  align="center" width="84" ><xsl:value-of select="DT"/>
      <input type="hidden" name="houseDestTerminal"  value="{DT}"/>
      </td>
      <td  align="center" width="89" ><xsl:value-of select="SNAME"/>
      <input type="hidden" name="houseShipperId"  value="{SHID}"/>
      <input type="hidden" name="houseShipperName" value='{SNAME}'/>
      </td>
      <td  align="center" width="80" ><xsl:value-of select="CGNAME"/>
      <input type="hidden" name="houseConsigneeId"  value="{CHID}"/>
      <input type="hidden" name="houseConsigneeName" value='{CGNAME}'/>
      </td >

       <td   align="center" ><xsl:value-of select="SL"/>
      <input type="hidden" name="houseServiceLevelId" value='{SL}'/>                        
      <input type="hidden" name="houseServiceType" value='{PM}'/>                
      </td>
      <td   align="center" ><xsl:value-of select="PCS"/>
      <input type="hidden" name="houseTotalPieces" value='{PCS}'/>                        
      </td>
      <td  align="center" ><xsl:value-of select="GW"/>
      <input type="hidden" name="houseGrossWeight" value='{GW}'/>                        
      </td>
      <td  align="center" ><xsl:value-of select="CW"/>
      <font color='Green' size='1'>&nbsp;</font>
      <input type="hidden" name="houseChargeableWeight" value='{CW}'/>
      <input type="hidden" name="houseUOW" value='{UOW}'/>
      <input type="hidden" name="houseHazardousFlag" value='{HZD}'/>
      </td>
      <td  align="center" ><xsl:value-of select="VL"/><font color='Green' size='1'>&nbsp;<xsl:value-of select="VLUM"/></font>
      <input type="hidden" name="houseUOV" value='{VLUM}'/>       
       <input type="hidden" name="houseVolume" value='{VL}'/>
      </td>
      <td  align="center" ><xsl:value-of select="VOLUMETRIC_WT"/>
      <input type="hidden" name="houseVolumetric" value='{VOLUMETRIC_WT}'/>
      <input type="hidden" name="housedimFactor" value='{DFTR}'/>
      </td>
      <td  align="center" >&nbsp;<xsl:value-of select="duedate"/>
       <input type="hidden" name="houseDueDate" value=''/>
       <input type="hidden" name="houseDueTime" value=''/>
      <input type="hidden" name="houseUOMFlag" value='No'/>       
      <input type="hidden" name="isDomestic" id="isDomestic{position()}" value='{LEG_TYPE}'/>       
      <input type="hidden" name="bbStatus" id="bbStatus{position()}" value='{BB_STATUS}'/>
      <input type="hidden" name="hawbNo" id="hawbNo{position()}" value='{SNO}'/>
      <input type="hidden" name="routePlanId" id="routePlanId{position()}"  value='{RTID}'/>
      <input type="hidden" name="houseRoutePlanId" id="houseRoutePlanId{position()}"  value='{RTID}'/>
      <input type="hidden" name="hawbSeqNo" id="hawbSeqNo{position()}"   value='{SNO}'/>
      <input type="hidden" name="shipmentStatus" id="shipmentStatus{position()}"  value='{SS}'/>
      <input type="hidden" name="isAttachable" id="isAttachable{position()}"  value='YES'/>
      <input type="hidden" name="housePrintFlag"  id="housePrintFlag{position()}"  value='{PF}'/>
      <input type='hidden' name="houseSystemFlag" id="houseSystemFlag{position()}" value="{SYS_FLAG}"/>
      <input type='hidden' name="hawbFlag"  id="hawbFlag{position()}"  value="{HOUSE_TYPE}"/>
       </td>
      </tr>
          </table>
</xsl:if>
      </xsl:for-each>







 <table width="760" border="0" cellspacing="1" cellpadding="2">
          <tr class='denotes'>
            <td align="center" colspan="9">

      <input type="hidden" name="subOperation" value="FetchSeaShipments"/>
      <input type="hidden" name="SubOperation" value="FetchAirShipments"/>
      <input type="hidden" name="operation" value=""/>
      <input type="hidden" name="taskName" value="FetchAirShipments"/>
      <input type="hidden" name="ShipmentMode" value=""/>
      <input type="button" name="Submit" id="Submit" value="ENTER" class='input'>
      <xsl:attribute name="onClick">
      getCheckedResults("<xsl:value-of select='count(//ROW)'/>")
      </xsl:attribute>
      </input>
            </td>
          </tr>
        </table>
      
</xsl:template>
</xsl:stylesheet>

i am getting this error why

XSL-1047: (Error) Invalid instantiation of 'xsl:value' in 'table' context
0
Comment
Question by:chaitu chaitu
  • 2
2 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 11881391
Element should be <xsl:value-of and not <xsl:value
0
 
LVL 19

Accepted Solution

by:
ramazanyich earned 250 total points
ID: 11881409
It is in template "firstone"
check line
counte11r:<xsl:value select="$ctr"/>
and replace <xsl:value with <xsl:value-of
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question