Please upgrade your web browser now. Internet Explorer 6 is no longer supported.
Thinking Web Solutions?
We create smart, fun, functional websites that make your web a better place.

Viewing webpart XML

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.

Post a comment