Freigeben über


Visualizing Data using XSLT: Following up on SPC 2009’s session on Building SharePoint Mashups With SPD, Bing Maps and REST Services

Doreen There’s been a lot of interest in the demo that was done at the SharePoint Conference where we used XSLT to visualize a contact list as a map. We have existing information out there on this topic so we wanted to bring it all together in one blog entry. I’ll also walk through the XSL file that was used in our demo and provide some pointers on how to use it for your own development.

For our demo, we mashed up a contacts list with a map and then created a detail page where we pull in information for a specific contact from Twitter and MSN Weather for our contact’s specific location. (To see how to do this using SharePoint Designer 2007, see this blog.)

We had lots of request for the details behind the XSL file that was used in our demo, which is attached to the end of this post. Let’s talk through some key things:

In the first part of the XSLT, the map is created. For your own map, you’ll need to generate a key specific to your site collection.

Figure 1

Figure 1. First part of the XSLT used for the map visualization where the map key is specified.

The next section of the XSLT file will place a marker in the correct location for each of the contacts in our list.

Figure 2

Figure 2. Next part of XSLT where the map is created and each location specified by a marker.

Finally, we have the details of how the address is built and used to get the latitude/longitude from the map services as well as our custom code to show the details in a bubble with a link to our details page.

Figure 3

This file was very specific for our demo so before you hit up against its limitations, check out this blog posting on using XSLT from one of our developers, Jon Campbell.

We hope this answers any questions that came out of the conference session and more than that, we hope that compiling all of this information on the use of XSLT in one place helps make it easier to build into your own projects.

- Doreen Grieb

demoGmap.xsl

Comments

  • Anonymous
    March 03, 2010
    Provide useful information like this was a good explanation, thank you