Please upgrade your web browser now. Internet Explorer 6 is no longer supported.
Zac Smith
SharePoint, WSS and MOSS development.

Viewing webpart XML

by Zac Smith 30-Mar-07, 0 Comments
I really like how heaps of the new webparts in v3 and moss have an XSL editor to control their appearance.
However I often find it a bit of pain not really knowing what the XML looks like. Had a search round the web to see if I could find a way of outputing the xml.
Found this thing called xml-to-string that does exactly that.
How do you use it?
Just upload the xml-to-string.xsl file to a doc library somewhere on your site. Then you can reference it in your xsl like so:
<xsl:include href="xml-to-string.xsl" />
 
and to view the entire xml output just add the follwing line to the root template:
 
<!-- XSL transformation starts here -->
<xsl:template match="/">  
    <!-- add this line -->
    <xsl:call-template name="xml-to-string" />-->
 
    ....
 
</xsl:template>
 
sample output:
XML Snippet
 
 
I used this in a search webpart to see if my managed properties where coming through. Turned out they were there but had just been lower cased.

 
 
Categories: SharePoint
0 responses so far:

     

Post a Comment:
Name:
URL:
Email:
Comments: