Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • pooja 15 posts 35 karma points
    Sep 22, 2011 @ 11:58
    pooja
    0

    what "/*" does ?

    <xsl:for-each select="msxml:node-set($selecter)/*">

    in the  article first convert it to a node-set using the msxsl:node-set()"  suggested to use /*  after setting a node-set.

    I have used that but while populating data from second list.then my second list is not showing any data?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 22, 2011 @ 13:55
    Chriztian Steinmeier
    1

    Hi pooja,

    The node-set() function is necessary in two situations:

    1. You've created a variable using the copy-of instruction:

    <xsl:variable name="nodes">
        <xsl:copy-of select="$currentPage/*" />
    </xsl:variable>
    

    2. You've created an XML variable:

    <xsl:variable name="colours">
        <colors>
            <color id="main">#314159</color>
            <color id="secondary">#ff8000</color>
        </colors>
    </xsl:variable>

    Neither of these variables can be "navigated" using XPath - but you can use the node-set() function to enable that:

    <xsl:variable name="allNodes" select="msxsl:node-set($nodes)" />
    <xsl:variable name="allColors" select="msxsl:node-set($colors)/colors/color" />
    
    <!-- Find the "About" page's id: -->
    <xsl:value-of select="$allNodes[@nodeName = 'About']/@id" />
    
    <!-- Write some special CSS: -->
    <style>
    article .news {
        color: <xsl:value-of select="$allColors[@id = 'secondary']" />
    }
    </style>
    

    As you can see, the "/*" that's tacked on to the selector you specified is just used to navigate down into the variable - it works the same as all the other places you use XPath, so you should know a little about the actual XML you're querying to get meaningful results out.

    Most likely, the $selecter variable is empty, or only points to a single element with no children. 

    /Chriztian

     

     

  • pooja 15 posts 35 karma points
    Sep 22, 2011 @ 16:23
    pooja
    0

    hi Chriztian,

    thanks for reply,

    you have suggested this to use in one of the

    • "first convert it to a node-set using the msxsl:node-set()" blog.

    I am populating data from 3 share-point list in 1 dataview and grouping the data from 2 list.

    I want to group by this column dynamically so i kept my Query in 1 variable and then assignig this to Row by using 

    msxml:node-set($selecter)/*

    if apply above syntax to my 1st list then my second list is not showing any data if i am using this two second list then my 3rd list is not showing any thing can you please help me

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 24, 2011 @ 16:48
    Chriztian Steinmeier
    0

    Hi pooja,

    I need to see how you're getting the data - probably also some of the data as well; but post some of your XSLT for this and let's have a look.

    /Chriztian

  • pooja 15 posts 35 karma points
    Sep 24, 2011 @ 19:03
    pooja
    0

     

    //settting a variable to assign to rows variable by checking user in which group.

     
        
       <xsl:template name="dvt_1">
      <xsl:variable name="dvt_StyleName">Table</xsl:variable>
      
      <xsl:variable name="test" >
      <xsl:choose>
      <xsl:when test="$useringroup='PO'">
      <xsl:copy-of select="/dsQueryResponse/Process/Rows/Row[@ActiveState='1' and string(substring-after(substring-after(substring-before(string(@ProcessOwner),'&lt;/A&gt;'),'ID='),'&gt;')) = $UserID  and  string(@ProcessState)!='New']"></xsl:copy-of>
      </xsl:when>
      <xsl:otherwise></xsl:otherwise>
      </xsl:choose>
      
      <!--<xsl:call-template name="filter"></xsl:call-template>-->
      </xsl:variable>

      
      
      
      
       
     // assigning that variable here if i do not use/* then it will not show any result.
     

     <xsl:variable name="Rows" select="/dsQueryResponse/Process/Rows/Row[@ActiveState='1' and string(substring-after(substring-after(substring-before(string(@ProcessOwner),'&lt;/A&gt;'),'ID='),'&gt;')) = $UserID  and  string(@ProcessState)!='New']"></xsl:variable><xsl:variable name="dvt_RowCount" select="count($Rows)" /><xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0" /><xsl:choose>
       <xsl:when test="$dvt_IsEmpty">
        <xsl:call-template name="dvt_1.empty" />
       </xsl:when>
       <xsl:otherwise><table width="100%" border="0" cellspacing="0" cellpadding="0"   style="border-collapse:collapse" bordercolor="#d1e2fc">
       <tr valign="top">
        <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
         <th class="ms-vh" nowrap="nowrap"></th>
        </xsl:if>
        <th class="ms-vh" nowrap="" style="width:100px;border-right:1px solid white;padding-left:35px;">Test Name</th>    
        <th class="ms-vh" nowrap=""  style="display:none">Test Instructions</th>
        <th class="ms-vh" nowrap="" style="border-right:1px solid white;">Test Frequency</th>
        <th class="ms-vh" nowrap="" style="border-right:1px solid white;">Test Period</th>
       </tr>
       <xsl:call-template name="dvt_1.body">
        <xsl:with-param name="Rows" select="$Rows"/>
        <xsl:with-param name="FirstRow" select="1" />
        <xsl:with-param name="LastRow" select="$dvt_RowCount" />
       </xsl:call-template>
      </table></xsl:otherwise>
      </xsl:choose>
      
      
     </xsl:template>

       
        
       
       

                                                                

        

    after getting this by using a subview i am gettiing data from my second list but my second list not showing any data. and does not give any error  so i am not able to understand the problem.

    If i directlly assign my query to rows variable then It will not have any problem.

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 24, 2011 @ 22:37
    Chriztian Steinmeier
    0

    Hi pooja,

    I'm sorry, but I don't see the node-set() function anywhere - are you even doing this in Umbraco?

    I don't know how stuff works in SharePoint, so I really can't help you with that.

    Does your XSLT get processed multiple times - sounds a bit like it...

    /Chriztian 

  • pooja 15 posts 35 karma points
    Sep 26, 2011 @ 10:56
    pooja
    0

    hi chiriztian,

    thanks

    no i am not doing this in Umbraco.

    ya i am working in sharepoint and  I am hoping that xslt is same at every one.

    sorry for bad code copying.

    <xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
     <xsl:output method="html" indent="no"/>
     <xsl:decimal-format NaN=""/>
     <xsl:param name="dvt_apos">&apos;</xsl:param>
     <xsl:param name="dvt_groupfield" />
     <xsl:param name="UserID">CurrentUserName</xsl:param>
     <xsl:param name="useringroup" select="'PO'"></xsl:param>

     <xsl:variable name="dvt_1_automode">0</xsl:variable>
     
     
     <xsl:template match="/">
      <xsl:call-template name="dvt_1"/>
     </xsl:template>
     <xsl:template name="dvt_1">
      <xsl:variable name="dvt_StyleName">Table</xsl:variable>
      
      <xsl:variable name="test" >
      <xsl:choose>
      <xsl:when test="$useringroup='PO'">
      <xsl:copy-of select="/dsQueryResponse/Process/Rows/Row[@ActiveState='1' and string(substring-after(substring-after(substring-before(string(@ProcessOwner),'&lt;/A&gt;'),'ID='),'&gt;')) = $UserID  and  string(@ProcessState)!='New']"></xsl:copy-of>
      </xsl:when>
      <xsl:otherwise></xsl:otherwise>
      </xsl:choose>
      
      <!--<xsl:call-template name="filter"></xsl:call-template>-->
      </xsl:variable>
    <xsl:variable name="Rows" select="msxsl:node-set($test)/*"></xsl:variable>
     <!-- <xsl:variable name="Rows" select="/dsQueryResponse/Process/Rows/Row[@ActiveState='1' and string(substring-after(substring-after(substring-before(string(@ProcessOwner),'&lt;/A&gt;'),'ID='),'&gt;')) = $UserID  and  string(@ProcessState)!='New']"></xsl:variable>-->
     <xsl:variable name="dvt_RowCount" select="count($Rows)" /><xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0" /><xsl:choose>
       <xsl:when test="$dvt_IsEmpty">
        <xsl:call-template name="dvt_1.empty" />
       </xsl:when>
       <xsl:otherwise><table width="100%" border="0" cellspacing="0" cellpadding="0"   style="border-collapse:collapse" bordercolor="#d1e2fc">
       <tr valign="top">
        <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
         <th class="ms-vh" nowrap="nowrap"></th>
        </xsl:if>
        <th class="ms-vh" nowrap="" style="width:100px;border-right:1px solid white;padding-left:35px;">Test Name</th>    
        <th class="ms-vh" nowrap=""  style="display:none">Test Instructions</th>
        <th class="ms-vh" nowrap="" style="border-right:1px solid white;">Test Frequency</th>
        <th class="ms-vh" nowrap="" style="border-right:1px solid white;">Test Period</th>
       </tr>
       <xsl:call-template name="dvt_1.body">
        <xsl:with-param name="Rows" select="$Rows"/>
        <xsl:with-param name="FirstRow" select="1" />
        <xsl:with-param name="LastRow" select="$dvt_RowCount" />
       </xsl:call-template>
      </table></xsl:otherwise>
      </xsl:choose>
      
      
     </xsl:template>
     

     
     <xsl:template name="dvt_1.body">
      <xsl:param name="Rows"/>
      <xsl:param name="FirstRow" />
      <xsl:param name="LastRow" />
      <xsl:variable name="dvt_Rows"><root>
          <xsl:for-each select="$Rows">
              <xsl:sort select="string(@ID)" order="ascending" />
              <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow)"><xsl:copy-of select="." /></xsl:if>
          </xsl:for-each>
          </root></xsl:variable>
      <xsl:for-each select="$Rows">
       <xsl:sort select="string(@ID)" order="ascending" />
       <xsl:variable name="NewGroup_0">
           <xsl:choose>
               <xsl:when test="not ($dvt_groupfield)"><xsl:value-of select="ddwrt:NameChanged(string(string(@ID)), 0)" /></xsl:when>
               <xsl:otherwise></xsl:otherwise>
           </xsl:choose>
       </xsl:variable>
       <xsl:choose>
           <xsl:when test="0" />
           <xsl:when test="not($dvt_groupfield) and (not($NewGroup_0='') and position() &gt;= $FirstRow and position() &lt;= $LastRow or ($FirstRow = position()))">
               <xsl:variable name="groupheader0">
                   <xsl:choose>
                       <xsl:when test="not (string(@ID)) and (string(@ID)) != false()"><xsl:value-of select="' '" /></xsl:when>
                       <xsl:otherwise><xsl:value-of select="string(@ID)" /></xsl:otherwise>
                   </xsl:choose>
               </xsl:variable>
               <xsl:if test="not ((position()=1) or (position()=$FirstRow))"></xsl:if>
               <xsl:call-template name="dvt_1.groupheader0">
                   <xsl:with-param name="fieldtitle"></xsl:with-param>
                   <xsl:with-param name="fieldname"></xsl:with-param>
                   <xsl:with-param name="fieldvalue" select="$groupheader0" />
                   <xsl:with-param name="fieldtype" select="''" />
                   <xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//msxsl:node-set[((string ( @ID ) )=$groupheader0 or ((not(string ( @ID ) ) or string ( @ID ) ='') and $groupheader0=' '))]" />
                   <xsl:with-param name="groupid" select="'0'" />
                   <xsl:with-param name="displaystyle" select="'auto'" />
                   <xsl:with-param name="imagesrc" select="'/_layouts/images/minus.gif'" />
                   <xsl:with-param name="alttext" select="'collapse'" />
                   <xsl:with-param name="altname" select="'expand'" />
                   <xsl:with-param name="hidedetail" select="false()" />
                   <xsl:with-param name="showheader" select="true()" />
                   <xsl:with-param name="showheadercolumn" select="false()" />
               </xsl:call-template>
           </xsl:when>
       </xsl:choose>
       
       
       
       
       <xsl:variable name="BreakOut">
           <xsl:choose>
               <xsl:when test="not($dvt_groupfield) and position()=$LastRow+1"><xsl:value-of select="ddwrt:NameChanged('', -1)" /></xsl:when>
               <xsl:otherwise>BreakOut</xsl:otherwise>
           </xsl:choose>
       </xsl:variable>
       
       
       
       
       <xsl:variable name="dvt_KeepItemsTogether" select="false()" />
       <xsl:variable name="dvt_HideGroupDetail" select="false()" />
       <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">
           <xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
           
               <xsl:call-template name="dvt_1.rowview" >
               
                   <xsl:with-param name="ID" select="string(@ID)"></xsl:with-param>
               </xsl:call-template>

        </xsl:if>
       </xsl:if>
       <xsl:choose>
           <xsl:when test="0" />
       </xsl:choose>
       
       
       
       
      </xsl:for-each>
      
      
      
      
      
      
      
     </xsl:template>
     <xsl:template name="dvt_1.rowview">
     <xsl:param name="ID"></xsl:param>
     <tr>
       <xsl:if test="position() mod 2 = 1">
        <xsl:attribute name="class">ms-alternating</xsl:attribute>
       </xsl:if>
       <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
        <td class="ms-vb" width="1%" nowrap="nowrap">
         <span ddwrt:amkeyfield="" ddwrt:amkeyvalue="string($XPath)" ddwrt:ammode="view"></span>
        </td>
       </xsl:if>
       <td   colspan="4"  valign="top">
        <!--<xsl:value-of select="@Title"/>-->
        <xsl:call-template name="dvt_2" >
        <xsl:with-param name="PID" select="$ID"></xsl:with-param>
        </xsl:call-template>

       </td>
      </tr>
     </xsl:template>
     <xsl:template name="dvt_1.groupheader0">
      <xsl:param name="fieldtitle" />
      <xsl:param name="fieldname" />
      <xsl:param name="fieldvalue" />
      <xsl:param name="fieldtype" />
      <xsl:param name="nodeset" />
      <xsl:param name="groupid" />
      <xsl:param name="displaystyle" />
      <xsl:param name="imagesrc" />
      <xsl:param name="alttext" />
      <xsl:param name="altname" />
      <xsl:param name="hidedetail" />
      <xsl:param name="showheader" />
      <xsl:param name="showheadercolumn" />
      <xsl:if test="$showheader" ddwrt:cf_ignore="1">
       <tr id="group{$groupid}" style="display:{$displaystyle}">
        <td class="ms-gb" style="background:#b6d7e2;padding-left:5px"  colspan="4">
         <xsl:choose>
          <xsl:when test="$groupid='0' or $groupid='9'">
           <xsl:text></xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='1'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='2'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:otherwise>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:otherwise>
         </xsl:choose>
         <xsl:if test="not($hidedetail)" ddwrt:cf_ignore="1">
          <a href="javascript:" onclick="javascript:ExpGroupBy(this);return false;">
           <img src="{$imagesrc}" border="0" alt="{$alttext}" name="{$altname}" /></a>
         </xsl:if>
         
          Process Name:<b>
          <xsl:value-of select="$fieldtitle" />
         </b>
         <xsl:if test="$fieldtitle">: </xsl:if>
         <xsl:choose>
          <xsl:when test="$fieldtype='url'">
           <a href="{$fieldvalue}">
            <xsl:value-of select="$fieldvalue" />
           </a>
          </xsl:when>
          <xsl:when test="$fieldtype='user'">
           <xsl:value-of select="$fieldvalue" disable-output-escaping="yes" />
          </xsl:when>
          <xsl:otherwise>
           <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve"> </xsl:text>
           <a href="ViewProcessByID.aspx?ProcessID={@ID}&amp;Redirect=ViewAllProcesses"><xsl:value-of select="@Title" /></a>
           
           <xsl:choose>
            <xsl:when test="@PublishStatusPO='Pending Approval'">
             <font color="orange"><strong><xsl:text> (RCSA Pending Approval)</xsl:text></strong></font>
            </xsl:when>
            <xsl:when test="@PublishStatusPO='Rejected'">
             <font color="red"><strong><xsl:text> (RCSA Rejected)</xsl:text></strong></font>
            </xsl:when>
            <xsl:when test="@PublishStatusPO='Approved'">
             <font color="green"><strong><xsl:text> (RCSA Approved)</xsl:text></strong></font>
            </xsl:when>
            
            
           </xsl:choose>
          </xsl:otherwise>
         </xsl:choose>
        </td>
       </tr><tr id="group{$groupid}" style="display:{$displaystyle}"><td class="ms-gb" style="background:#b6d7e2;padding-left:5px" colspan="4">
           <xsl:call-template name="dvt_4" />
           <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text>
           </td></tr></xsl:if>
      <xsl:if test="$showheadercolumn" ddwrt:cf_ignore="1"><tr valign="top">
        <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
         <th class="ms-vh" width="1%" nowrap="nowrap"></th>
        </xsl:if>
        <!--<th class="ms-vh" nowrap="" style="width: 295px">Process Short Description</th>
        
        <th class="ms-vh" nowrap="">TestInstructions</th>
        <th class="ms-vh" nowrap="">Testfrequency</th>
        <th class="ms-vh" nowrap="">TestPeriod</th>-->

       </tr></xsl:if>
     </xsl:template>
     <xsl:variable name="dvt_2_automode">0</xsl:variable>
     <xsl:template name="dvt_2">
     <xsl:param name="PID"></xsl:param>
     
    <xsl:variable name="dvt_StyleName">Table</xsl:variable>
      <xsl:variable name="dvt_ParentRow" select="current()" />
      ID:<xsl:value-of select="current()"></xsl:value-of><xsl:variable name="test" >
      <xsl:choose>
      <xsl:when test="$useringroup='PO'">
      <xsl:copy-of select="../../../ControlTest/Rows/Row[normalize-space(@ProcessID) = normalize-space($dvt_ParentRow/@ID) and  normalize-space(@ControlsDraftID) = '' and (normalize-space(@ApprovalStatus) = 'Approved'   or string(substring-after(substring-after(substring-before(string(@Author),'&lt;/A&gt;'),'ID='),'&gt;')) = $UserID)]"></xsl:copy-of>
      <!--<xsl:copy-of select="../dsQueryResponse/ControlTest/Rows/Row"></xsl:copy-of>-->
      </xsl:when>
      <xsl:otherwise></xsl:otherwise>
      </xsl:choose>
      
      <!--<xsl:call-template name="filter"></xsl:call-template>-->
      </xsl:variable>
      <xsl:variable name="Rows" select="msxsl:node-set($test)/*" />
      <xsl:variable name="dvt_RowCount" select="count($Rows)" />
      <xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0" /><xsl:choose>
       <xsl:when test="$dvt_IsEmpty">
        <xsl:call-template name="dvt_2.empty" />
       </xsl:when>
       <xsl:otherwise><table border="0"  cellpadding="0" cellspacing="0" width="100%"  >
       <tr valign="top">
        <xsl:if test="$dvt_2_automode = '1'" ddwrt:cf_ignore="1">
         <th class="ms-vh" width="1%" nowrap="nowrap"></th>
        </xsl:if>
        
        
       </tr>
       <xsl:call-template name="dvt_2.body">
        <xsl:with-param name="Rows" select="$Rows" />
        <xsl:with-param name="dvt_ParentRow" select="$dvt_ParentRow" />
        <xsl:with-param name="FirstRow" select="1" />
        <xsl:with-param name="LastRow" select="$dvt_RowCount" />
       </xsl:call-template>
      </table></xsl:otherwise>
      </xsl:choose>
      
     </xsl:template>
     <xsl:template name="dvt_2.body">
      <xsl:param name="Rows" />
      <xsl:param name="dvt_ParentRow" />
      <xsl:param name="FirstRow" />
      <xsl:param name="LastRow" />
      <xsl:variable name="dvt_Rows"><root>
       <xsl:for-each select="$Rows">
        <xsl:sort select="@Title" order="ascending" />
        <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow)"><xsl:copy-of select="." /></xsl:if>
       </xsl:for-each>
       </root></xsl:variable>
      <xsl:for-each select="$Rows">
       <xsl:sort select="@Title" order="ascending" />
       <xsl:variable name="NewGroup_0">
           <xsl:choose>
               <xsl:when test="not ($dvt_groupfield)"><xsl:value-of select="ddwrt:NameChanged(string(@Title), 0)" /></xsl:when>
               <xsl:otherwise></xsl:otherwise>
           </xsl:choose>
       </xsl:variable>
       <xsl:choose>
           <xsl:when test="0" />
           <xsl:when test="not($dvt_groupfield) and (not($NewGroup_0='') and position() &gt;= $FirstRow and position() &lt;= $LastRow or ($FirstRow = position()))">
               <xsl:variable name="groupheader0">
                   <xsl:choose>
                       <xsl:when test="not (@Title) and (@Title) != false()"><xsl:value-of select="' '" /></xsl:when>
                       <xsl:otherwise><xsl:value-of select="@Title" /></xsl:otherwise>
                   </xsl:choose>
         </xsl:variable>
               <xsl:if test="not ((position()=1) or (position()=$FirstRow))"></xsl:if>
               <xsl:call-template name="dvt_2.groupheader0">
                   <xsl:with-param name="fieldtitle"></xsl:with-param>
                   <xsl:with-param name="fieldname">Title</xsl:with-param>
                   <xsl:with-param name="fieldvalue" select="$groupheader0" />
                   <xsl:with-param name="fieldtype" select="''" />
                   <xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//Row[((@Title)=$groupheader0 or ((not(@Title) or @Title='') and $groupheader0=' '))]" />
                   <xsl:with-param name="groupid" select="'0'" />
                   <xsl:with-param name="displaystyle" select="'auto'" />
                   <xsl:with-param name="imagesrc" select="'/_layouts/images/minus.gif'" />
                   <xsl:with-param name="alttext" select="'collapse'" />
                   <xsl:with-param name="altname" select="'expand'" />
                   <xsl:with-param name="hidedetail" select="false()" />
                   <xsl:with-param name="showheader" select="true()" />
                   <xsl:with-param name="showheadercolumn" select="false()" />
               </xsl:call-template>
        </xsl:when>
       </xsl:choose>
       
       
       
       <xsl:variable name="BreakOut">
           <xsl:choose>
               <xsl:when test="not($dvt_groupfield) and position()=$LastRow+1"><xsl:value-of select="ddwrt:NameChanged('', -1)" /></xsl:when>
               <xsl:otherwise>BreakOut</xsl:otherwise>
           </xsl:choose>
       </xsl:variable>
       
       
       
               <xsl:call-template name="dvt_2.rowview" />
       <xsl:choose>
           <xsl:when test="0" />
       </xsl:choose>
       
       
       
      </xsl:for-each>
      
      
      
      
      
      
      
     </xsl:template>
     <xsl:template name="dvt_2.rowview">
      <tr>
       <xsl:if test="position() mod 2 = 1">
        <xsl:attribute name="class">ms-alternating</xsl:attribute>
       </xsl:if>
       <xsl:if test="$dvt_2_automode = '1'" ddwrt:cf_ignore="1">
        <td class="ms-vb" width="1%" nowrap="nowrap">
         <span ddwrt:amkeyfield="" ddwrt:amkeyvalue="string($XPath)" ddwrt:ammode="view"></span>
        </td>
       </xsl:if>
       <td    >
        <!--<xsl:value-of select="@Title" />-->
        <xsl:call-template name="dvt_3" />
       </td>
       
      </tr></xsl:template>
     <xsl:template name="dvt_2.groupheader0">
      <xsl:param name="fieldtitle" />
      <xsl:param name="fieldname" />
      <xsl:param name="fieldvalue" />
      <xsl:param name="fieldtype" />
      <xsl:param name="nodeset" />
      <xsl:param name="groupid" />
      <xsl:param name="displaystyle" />
      <xsl:param name="imagesrc" />
      <xsl:param name="alttext" />
      <xsl:param name="altname" />
      <xsl:param name="hidedetail" />
      <xsl:param name="showheader" />
      <xsl:param name="showheadercolumn" />
      <xsl:if test="$showheader" ddwrt:cf_ignore="1">
       <tr id="group{$groupid}" style="display:{$displaystyle}">
        <td class="ms-gb" style="background:#e0edf9;padding-left:15px;"   >
         <xsl:choose>
          <xsl:when test="$groupid='0' or $groupid='9'">
           <xsl:text></xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='1'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='2'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:otherwise>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:otherwise>
         </xsl:choose>
         <xsl:if test="not($hidedetail)" ddwrt:cf_ignore="1">
          <a href="javascript:" onclick="javascript:ExpGroupBy(this);return false;">
           <img src="{$imagesrc}" border="0" alt="{$alttext}" name="{$altname}" /></a>
         </xsl:if>
          Control Number: <b>
          <xsl:value-of select="$fieldtitle" />
         </b>
         <xsl:if test="$fieldtitle">: </xsl:if>
         <xsl:choose>
          <xsl:when test="$fieldtype='url'">
           <a href="{$fieldvalue}">
            <xsl:value-of select="$fieldvalue" />
           </a>
          </xsl:when>
          <xsl:when test="$fieldtype='user'">
           <xsl:value-of select="$fieldvalue" disable-output-escaping="yes" />
          </xsl:when>
          <xsl:otherwise>
           <a href="../ControlTest/DisplayCtrlByCtrlID.aspx?CtrlID={@ID}&amp;Redirect=ViewAllProcesses"><xsl:value-of select="@Title" /></a>
           <label id="label1{generate-id()}" style="display:none"><xsl:value-of select="@ID"/></label>
           <label id="label2{generate-id()}">
           <xsl:if test="@ControlsDraftID='' and (string(substring-after(substring-after(substring-before(string(@Author),'&lt;/A&gt;'),'ID='),'&gt;')) = $UserID) and @ApprovalStatus!='Approved'"><font color="green"><strong><xsl:text> (New)</xsl:text></strong></font></xsl:if>
           </label>
           <!--<font color="green"><strong><xsl:if test="@DraftUser='PO' and (@ApprovalStatus!='Approved')"><xsl:text> (New)</xsl:text></xsl:if></strong></font>-->
          </xsl:otherwise>
         </xsl:choose>
        </td>
       </tr>
      </xsl:if>
      <xsl:if test="$showheadercolumn" ddwrt:cf_ignore="1"><tr valign="top">
        <xsl:if test="$dvt_2_automode = '1'" ddwrt:cf_ignore="1">
         <th class="ms-vh" width="1%" nowrap="nowrap"></th>
        </xsl:if>
        
        
       </tr></xsl:if>
     </xsl:template>
     <xsl:variable name="dvt_3_automode">0</xsl:variable>
     <xsl:template name="dvt_3">
      <xsl:variable name="dvt_StyleName">Table</xsl:variable>
      <!--<xsl:variable name="dvt_ParentRow" select="current()" />-->
      <xsl:variable name="test" select="../../../Tests/Rows/Row"/>
      <xsl:variable name="Rows" select="../../../Tests/Rows/Row" />
      
      
      
      <xsl:variable name="dvt_IsEmpty" select ="dvt_RowCount=0"/>
      <xsl:choose>
       <xsl:when test="$dvt_IsEmpty">
        <xsl:call-template name="dvt_3.empty" />
       </xsl:when>
       <xsl:otherwise><table border="1" cellspacing="0"  class="LrgFormsTbl" bordercolor="#d1e2fc" id="TestTable">
       <tr valign="top">
        <xsl:if test="$dvt_3_automode = '1'" ddwrt:cf_ignore="1">
         <th class="ms-vh" width="1%" nowrap="nowrap"></th>
        </xsl:if>
        
       </tr>
       <xsl:call-template name="dvt_3.body">
        <xsl:with-param name="Rows" select="$Rows" />
        <!--<xsl:with-param name="dvt_ParentRow" select="$dvt_ParentRow" />-->
       </xsl:call-template>
      </table></xsl:otherwise>
      </xsl:choose>
      
     </xsl:template>
     <xsl:template name="dvt_3.body">
      <xsl:param name="Rows" />
      <!--<xsl:param name="dvt_ParentRow" />-->
      <xsl:for-each select="$Rows">
       <xsl:sort select="@Title" order="ascending" />
       <xsl:call-template name="dvt_3.rowview" />
       
      </xsl:for-each>
      <xsl:call-template name="dvt_3.summary">
          <xsl:with-param name="Rows" select="$Rows" />
      </xsl:call-template>
     </xsl:template>
     <xsl:template name="dvt_3.rowview">
      
      <tr>
       <xsl:if test="position() mod 2 = 1">
        <xsl:attribute name="class">ms-alternating</xsl:attribute>
       </xsl:if>
       <xsl:if test="$dvt_3_automode = '1'" ddwrt:cf_ignore="1">
        <td class="ms-vb" width="1%" nowrap="nowrap">
         <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
        </td>
       </xsl:if>
       <!--<xsl:otherwise>-->
       <!--</xsl:otherwise>-->
       <td class="ms-vb"  width="320" style="padding-left:35px;">
        <a href="../Tests/ViewTestDetailsByID.aspx?TestID={@ID}&amp;Redirect=ViewAllProcesses"><xsl:value-of select="@Title" /></a>
    <!--    <xsl:if test="@DraftUser='PO' and (@ApprovalStatus!='Approved')">-->
        <label id="testIDLbl" style="display:none">
         <xsl:value-of select="@ID" />
        </label>
        <label id="statusLabel"><xsl:if test="@TestsDraftID='' and (string(substring-after(substring-after(substring-before(string(@Author),'&lt;/A&gt;'),'ID='),'&gt;')) = $UserID) and @ApprovalStatus!='Approved'"><font color="green"><strong><xsl:text> (New)</xsl:text></strong></font></xsl:if>
           </label>

    <!--     <font color="green"><B><xsl:text disable-output-escaping="yes"> (New)</xsl:text></B></font>-->
    <!--    </xsl:if>-->

       </td>
          
       
       
       <td class="ms-vb" style="display:none" >
        <xsl:value-of select="@TestInstructions" disable-output-escaping="yes"  />
       </td>
       <td class="ms-vb" style="width: 285px" >
        <xsl:value-of select="@Testfrequency" />
       </td>
       <td class="ms-vb" style="width: 209px" >
        <xsl:value-of select="@TestPeriod" />
       </td>
       </tr>
      </xsl:template>
     <xsl:template name="dvt_1.empty">
      <xsl:variable name="dvt_ViewEmptyText">No records found.</xsl:variable>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
       <tr>
        <td class="ms-vb" align="center">
         <xsl:value-of select="$dvt_ViewEmptyText" />
        </td>
       </tr>
      </table>
     </xsl:template>
     <xsl:template name="dvt_3.empty">
      <xsl:variable name="dvt_ViewEmptyText">There are no items to show in this view.</xsl:variable>
      <table border="0" width="100%">
       <tr>
    <!--    <td  align="center" style="font:bold 12px tahoma;" >-->
        <td  align="center" class="ms-vb" >
        <b>
         <xsl:value-of select="$dvt_ViewEmptyText" />!</b>
        </td>
       </tr>
      </table>
     </xsl:template>
     <xsl:template name="dvt_2.empty" >
      <xsl:variable name="dvt_ViewEmptyText">No Controls Defined For This Process!</xsl:variable>
      <table border="0" width="100%">
       <tr>
        <td class="ms-vb" align="center">
        <b><xsl:value-of select="$dvt_ViewEmptyText" /></b>
        </td>
       </tr>
      </table>
     </xsl:template>
     <xsl:template name="dvt_3.summary">
         <xsl:param name="Rows" />
         <tr valign="top">
             <xsl:if test="$dvt_3_automode = '1'" ddwrt:cf_ignore="1">
         <th class="ms-vh" width="1%" nowrap="nowrap"></th>
        </xsl:if>
         </tr>
     </xsl:template>
     <xsl:variable name="dvt_4_automode">0</xsl:variable>
     <xsl:template name="dvt_4">
         <xsl:variable name="dvt_StyleName">Table</xsl:variable>
         <xsl:variable name="dvt_ParentRow" select="current()" />
         <xsl:variable name="Rows" select="../../../ControlTest/Rows/Row[@ProcessID=$dvt_ParentRow/@ID]" />
         <table border="0" width="100%" cellpadding="2" cellspacing="0">
             <xsl:call-template name="dvt_4.body">
                 <xsl:with-param name="Rows" select="$Rows" />
                 <xsl:with-param name="dvt_ParentRow" select="$dvt_ParentRow" />
             </xsl:call-template>
         </table>
     </xsl:template>
     <xsl:template name="dvt_4.body">
         <xsl:param name="Rows" />
         <xsl:param name="dvt_ParentRow" />
         <xsl:for-each select="$Rows">
             <xsl:call-template name="dvt_4.rowview" />
         </xsl:for-each>
     </xsl:template>
     <xsl:template name="dvt_4.rowview">
      <tr>
          <xsl:if test="position() mod 2 = 1">
              <xsl:attribute name="class">ms-alternating</xsl:attribute>
          </xsl:if>
          <xsl:if test="$dvt_4_automode = '1'" ddwrt:cf_ignore="1">
        <td class="ms-vb" width="1%" nowrap="nowrap">
         <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
        </td>
       </xsl:if>
          <td class="ms-vb">
           <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;&#160; </xsl:text>
           <xsl:value-of select="@LinkTitle" />
           
       </td>
          
      </tr><tr><td class="ms-vb">
             <xsl:call-template name="dvt_5" />
             <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text>
             </td></tr></xsl:template>
     <xsl:variable name="dvt_5_automode">0</xsl:variable>
     <xsl:template name="dvt_5">
         <xsl:variable name="dvt_StyleName">Table</xsl:variable>
         <xsl:variable name="dvt_ParentRow" select="current()" />
         <xsl:variable name="Rows" select="../../../Tests/Rows/Row[@ControlID=$dvt_ParentRow/@ID]" />
         <table border="0" width="100%" cellpadding="2" cellspacing="0">
             <xsl:call-template name="dvt_5.body">
                 <xsl:with-param name="Rows" select="$Rows" />
                 <xsl:with-param name="dvt_ParentRow" select="$dvt_ParentRow" />
             </xsl:call-template>
         </table>
     </xsl:template>
     <xsl:template name="dvt_5.body">
         <xsl:param name="Rows" />
         <xsl:param name="dvt_ParentRow" />
         <xsl:for-each select="$Rows">
             <xsl:call-template name="dvt_5.rowview" />
         </xsl:for-each>
     </xsl:template>
     <xsl:template name="dvt_5.rowview">
      <tr>
          <xsl:if test="position() mod 2 = 1">
              <xsl:attribute name="class">ms-alternating</xsl:attribute>
          </xsl:if>
          <xsl:if test="$dvt_5_automode = '1'" ddwrt:cf_ignore="1">
        <td class="ms-vb" width="1%" nowrap="nowrap">
         <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
        </td>
       </xsl:if>
          <td class="ms-vb">
           <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;&#160;&#160; </xsl:text>
           <xsl:value-of select="@Testfrequency" />
           
       </td>
          
       <td class="ms-vb">
        <xsl:value-of select="@TestStatus" />
       </td>
       <td class="ms-vb">
        <xsl:value-of select="@TestPeriod" />
       </td>
      </tr></xsl:template>
    </xsl:stylesheet> 

     

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 26, 2011 @ 17:07
    Chriztian Steinmeier
    0

    Hi pooja,

    Two things you should consider:

    1. Code samples of that length are way better presented by posting them to a snippet service like Gist, Pastie or similar, where they'll be properly colour coded etc. Just post a link to in the forum post then.

    2. As this forum is specifically targeted Umbraco XSLT, you may not get the number of responses you'd like, and there may not be many with any SharePoint experience to help you. You may get better help in a SharePoint-targeted forum?

    /Chriztian

     

  • pooja 15 posts 35 karma points
    Sep 27, 2011 @ 06:43
    pooja
    0

    thanks Chriztian,

    Sorry for  big & bad code copy,

    I was thinking that xslt in umbraco n sharepoint is same so i have posted in this blog.

Please Sign in or register to post replies

Write your reply to:

Draft