XSLT Transformation of SP services Output XML

Jun 5, 2011 at 7:06 AM
Edited Jun 5, 2011 at 7:10 AM

Hi,

I am trying to transform the XML we are geting from SPServices Lib

Inside the XSLT file i am looping through the XML in this way

  <xsl:for-each select ="GetListItemsResponse/GetListItemsResult/listitems/data/row">           

                        <tr >
                      <xsl:if test="(position() mod 2 =1)">
                        <xsl:attribute name="bgcolor">#F0F0F0</xsl:attribute>                                               
                      </xsl:if>
                      <td align="center">
                        <div align="left">
                             <xsl:value-of select="@ows_LinkTitle" disable-output-escaping="yes"/>
                           </div>
                         </td>
                         <td align="center">
                           <a href="{@ows_LinkTitle}">
                             <xsl:value-of select="@ows_LinkTitle" disable-output-escaping="yes"/>                          
                          </a>

                      </td>
      <td align="center">

                        <xsl:value-of select="ows_LinkTitle" disable-output-escaping="yes"/>                          
                         

                      </td>                        
                    </tr>                   
                 
                  </xsl:for-each>

 

But for some reason i am not getting the value inside the for-each loop.Can anyone help me?

 

Also i am trying to transform the XML using "jquery.xslt.js"

This is my function

   $().SPServices({
            webURL: "http://website/site/mywork/demo/",
            operation: "GetListItems",
            listName: "GW.EKAS.PSM.Cnt",
            async: false,
            CAMLQuery: query,
            completefunc: function (OHHomeData, OHHomeStatus)
             {
                      alert( OHHomeData.responseText );
                     document.getElementById("dvpsm").innerHTML =  OHHomeData.responseText ;                  
                  $('#dvpsm').xslt(OHHomeData.responseText, "psm.xsl");
           
           }
        });

 

Coordinator
Jun 5, 2011 at 1:58 PM

Janesh:

Again, lots of examples here which show how to parse the XML. If you search these discussions a little, you'll see plenty of examples showing how to do it. You're trying to use XSL above, and there's no XSL interpreter client side.

I haven't used the jquery.xslt.js plugin. It may well help, but you're on your own there.

M.