When you think that you do all right, but Sunbox dataview not displaying what you want - you need to debug your code.
There is two main reasons why your code not work:
  1. Error while querying data (you can make a mistake in query options);
  2. Error while transforming source XML tree (you can wrote incorrect XSL template).

At the both of this types of problem you need to activate debug mode in the web part options ("Miscellaneous" section):


Press "Ok".

Error while querying data

When you activate Debug mode you will see all errors of querying data at the "Error" section.

Example: I edit my News data source and specify invalid Query parameter:
    <FieldRef Name="ID" ></FieldRef>
    <Value Type="Int">{querystring[id]}</Value>

After save settings I will see the next:


Go back and modify Query parameter:

      <FieldRef Name="ID" ></FieldRef>
      <Value Type="Int">{querystring[id]}</Value>

Now we see that out code works:


Sometimes SharePoint not returns the error message. If so, that you need to use developer tools (IE), web inspector (chrome) or firebug (firefox) to see what the query sending to SharePoint and what his return.

Error while transforming source XML tree

If you have no error of querying data and markup not shown anyway, that reason in XML transformation. At this sutuation you have two tabs (in debug mode):
  1. Source XML;
  2. Source XSL.

Sunbox dataview renders the content of this tabs before transformation starts.
In the "Source XML" tab you can see the source XML tree, which will transform.
In the "Source XSL" tab you can see source XSL template. Most browser edit them if it contains parsing errors.
For example I add an error to my XSL:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet1 version="1.0" xmlns:xsl="">
	<xsl:template match="/">
          <h3>Latest news:</h3>
          <div id="news-items">
            <xsl:for-each select="/response/News/Rows/Row">
              <a href="Lists/News/DispForm.aspx?ID={ID}">
                <xsl:value-of select="Title" />
              <p class="news-announcement">
                <xsl:value-of select="Announcement" />
          <div id="news-pager">

After saving in the "Source XSL" tab will appear parseerror text:


After analyzing them you can fix problem

For best validating of XSL you can use Visual Studio. After saving XSL you can open it at "Style Library/SUnbox/ SunboxDataView/XSL/<filename>.xsl" via WEBDAV protocol.

Read more: Binding query string parameters

Last edited Feb 8, 2012 at 5:44 AM by Bukharin, version 3


No comments yet.