This project has moved. For the latest updates, please go here.

XSLT Transformation of SP services Output XML

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


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>                                               
                      <td align="center">
                        <div align="left">
                             <xsl:value-of select="@ows_LinkTitle" disable-output-escaping="yes"/>
                         <td align="center">
                           <a href="{@ows_LinkTitle}">
                             <xsl:value-of select="@ows_LinkTitle" disable-output-escaping="yes"/>                          

      <td align="center">

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



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

            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");


Jun 5, 2011 at 12:58 PM


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.