1,804 articles and 14,839 comments as of Tuesday, May 17th, 2011

EndUserSharePoint has combined resources with NothingButSharePoint.com. You can now find End User (Mark Miller), Developer (Jeremy Thake) and IT Pro SharePoint content all in one place!

This site is a historical archive and is no longer being updated. Please update your favorites, bookmarks and RSS feeds.

NothingButSharePoint.com
Wednesday, June 2, 2010

The SPXSLT Codeplex Project – New XSL Templates

Author: Marc D. Anderson
http://mdasblog.wordpress.com

About a month ago, at the suggestion of @iwkid, I created a new Codeplex project called SPXSLT. My goal was to start providing a library of useful XSL templates for people to use in Data View Web Parts (DVWPs) or Content Query Web Parts (CQWPs) in SharePoint. It’s a bit different from most Codeplex projects in that (at least so far), I’m not building releases. I’m simply using the Documentation section of the project to contain the XSL templates and their descriptions.

With all the work I do with DVWPs, I often find myself copying and pasting utility templates that I’ve built over time from old projects into new ones. I’ve had my own messy store of these templates across my hard disks and VMs, and it seemed to make good sense to start sharing them for wider use. There’s zero point in any of us writing these things over and over (unless we really just want to work too hard).

I would suggest that you create a file (I usually call mine Utilities.XSL) and store it centrally for use in DVWPs and CQWPs across your sites. In WSS, I create a Document Library called XSL in the root site of the Site Collection and put the file there, along with any other commonly used XSL files. In MOSS, I store these XSL files in ‘/Style Library/XSL Style Sheets’.

You can then add any of the templates from SPXSLT that you want to use in the Utilities.xsl file and include these utility templates in your DVWPs. Take a look at my article Unlocking the Mysteries of Data View Web Part XSL Tags – Part 20: xsl:import to see how this process works.

The SPXSLT project has been languishing a bit, so today I added a set of new templates to get things moving again. The new templates are GetUserIDs, MailtoUser, and MailtoUsers.

The full inventory of templates which I currently have available is listed below.


Name
Short Description
Requires
Type
Categories
Displays the first N words from a string of text. (Use StripHTML first if your content includes markup.)
NA
Template
String
Given a nodeset and a percentile (expressed as a number from 0-100), returns the percentile value of a column.
NA
Template
Statistical
This template returns the user’s ID from a Person or Group value.
NA
Template
User
This template returns the user IDs from a Person or Group column which allows multi-select.
Template
User
This template returns the user’s name from a Person or Group value.
NA
Template
User
This template returns the user’s Email from a Person or Group value.
NA
Template
User
This template returns a mailto: link for the user’s Email from a Person or Group value.
NA
Template
User
This template returns mailto: links for the user Emails from a Person or Group column which allows multi-select.
Template
User
Strips the HTML tags out of a section of content.
NA
Template
HTML

As with my other Codeplex project, SPServices*, I’m always looking for ideas and submissions to help expand the capabilities for SPXSLT. Let me hear from you!

* A jQuery library which abstracts SharePoint’s Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install.

Author: Marc D. Anderson
http://mdasblog.wordpress.com

Marc D. Anderson is a Co-Founder and the President of Sympraxis Consulting LLC, based in Newton, MA.  He has over 25 years of experience as a technology consultant and line manager across a wide spectrum of industries and organizational sizes.  Marc has done extensive consulting on knowledge management and collaboration and what makes them actually work in practice. Read More.

 

Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!