SharePoint Config

Ari Bakker's thoughts on customising and configuring SharePoint

Viewing XML data from XSLT

without comments

This post shows how you can easily view the XML that is used in an XSL transform, so you can see the elements that you can use in the display.

I’m a big fan of using XSLT for presentation, so it is great to see that many of the web parts that MOSS and WSS 3.0 provide take advantage of this for rendering their output. To view the XML data that is used in the transform all you need to do is include the following line in your XSL template:

<xmp><xsl:copy-of select="."/></xmp>

This is great for viewing the internal SharePoint field names that are returned from list queries. For example if I include this in the ItemStyle.xsl that is used in the content query web part I get the following results:

In ItemStyle.xsl

<xsl:template name="Default" match="*" mode="itemstyle">
<xmp><xsl:copy-of select="."/></xmp>

Result

Content Query Xml Source

Great when you are customising these web parts!

Post to Twitter Post to Delicious Post to Digg Post to Reddit Post to StumbleUpon

Written by Ari Bakker

July 26th, 2007 at 8:14 am

Posted in Development

Leave a Reply

*