Show all XML properties (DVWP/XLV)

It’s often tricky to ‘debug’ the XSLT for a DataViewWebPart – and/or the new Cross-List View WebPart (XLV).

Usually the hardest part is working out the internal file names – and/or working out the “for each row” notion.

I find the best approach is to add a “ListView” – and then link to a separate XSLT file – which can then be tuned/tweaked within SharePoint Designer – as opposed to “all in one” – ie. one webpart (DVWP).

Let’s show with an example :

  • Create a SharePoint page
  • Edit page > Insert “Existing List”
  • Pick “Pages” (or any other list you like)

You get a List View WebPart – something similar to this :


Next step is to create an XSLT file that will render out ALL files – ALL rows – ALL values :

  • Click View All Site Content
  • Open the Style Library folder
  • Create a folder – entitled CustomXSLT – or whatever you like (perhaps company/client name)
  • Open Notepad – and paste in the following

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl=""&gt;
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xmp><xsl:copy-of select="*"/></xmp>

  • Save the file as something like all.xslt
  • Upload the file to the Style Library folder

Now – we can switch back to the list view you added earlier – and USE this new XSLT file.

  • Click Edit Page > Edit WebPart
  • Within the “Miscellaneous” section (!), set the XSL link to the file you uploaded

/Style Library/CustomXSLT/all.xslt


NOW – you should see ALL the data that the DVWP/XLV is displaying – very (VERY) useful !!

Especially when trying to work out the specific column/file names.


Here’s another very useful XSLT snippet – this does a “for each row”.

<xsl:stylesheet version="1.0" xmlns:xsl=""&gt;

<xsl:output method="html" indent="no"/>
  <xsl:template match="/" >
    <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
    <xsl:for-each select="$Rows">
            <xsl:value-of select="@Title"/>
        <xsl:value-of select="@Body" disable-output-escaping="yes"/>

…..hope this helps someone out there – or simply for MY later reference.


One thought on “Show all XML properties (DVWP/XLV)

  1. Sangeet Ahuja April 23, 2012 / 10:37 am

    Nice post Chris.
    How can one use SharePoint Designer to create reusable Item Style XSLT views ??

    Sangeet Ahuja (


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s