I almost overlooked this gem of a course in the pack of 57 SharePoint Courses on Puralsight.com. The title sounded similar to at least four other courses in the SharePoint Curriculum on Pluralsight.com. I’m glad I didn’t and chose instead to review it in depth.
It is hard in the midst of so many good courses to keep them all differentiated. At this time, Pluralsight lacks a personal history navigation interface: one where you can tell at a glance the courses taken and the current state of your progress in a given course. (Hint! Hint! Pluralsight!)
(Yes, there is a “Your history and bookmarks” displayed under your login name – but it only bookmarks the last 10 courses you’ve visited – barely a month’s worth for some of us more avid users!)
When I finally reviewed “Advanced SharePoint 2010 Branding for Web Designers”, I realized this course was huge in SharePoint learning experience and breadth of technology. To do this offering justice, I needed to do more than just casually watch the technology stream by on my monitor. This called for something more proactive which included building the demos on my home SharePoint 2010 virtual machine along with the videos presented by Mr. Guru, Ted Pattison.
As a SharePoint Developer of almost five years, I have found good coverage from the ground up of XML, XSLT and SharePoint Designer sorely lacking in SharePointdom. There are, of course, expert blogs on these topics but the complexity of the presentations frequently obscures any insights for us mere mortals.
Ted Pattison has long been a giant in SharePoint (heck, before that he was huge in COM+ programming. I’m pretty sure this dates both of us! Groovy! huh?).
It took Ted Pattison’s consummate skill to expound on XML, XSLT, and SharePoint Designer. He provides a workable pathway through this dense forest of learning.
On any of these topics, it would have been easy to leave the student stranded in the weeds. This didn’t happen. Ted provided a workable approach that lays claim to the basic principles of each discipline.
(You can quote me! I already have!)
Because of the uniqueness and novelty of Ted’s approach on the coverage of the XSLT and SharePoint Designer Integration, I have chosen to focus this article exclusively on these topics.
To allow depth for this topic I have segmented this piece into 4 parts for easier consumption by readers (The Mind can’t absorb more than the Seat.):
- The first covers basic XSLT Transforms of XML outside of SharePoint.
- The second covers XSLT within the SharePoint XML Viewer Web Part.
- The third covers SharePoint 2010 Designer more extensively with Conditional Logic and more complex XSLT Transforms.
- The final segment covers the XSLT involved in displaying a SharePoint Picture Library with extensive off-roading in SharePoint Designer.
My hope is that these four parts will serve as an addendum and adjunct to an innovative course.
Part I: Almost Bare Naked XML and XSLT
What makes this coverage interesting is the utility of the examples being used. Ted starts with basic XML and XSLT rendered just in the browser from an html wrapper. Then he progresses to one of the most complex tools in this author’s estimation, SharePoint 2010 Designer.
He entitles a section “World’s Fastest Introduction to XSLT”. I haven’t previously had occasion to use “fastest” and “XSLT” in the same sentence—or even the same paragraph for that matter. His video and examples provide the student with material to work through this maze and emerge knowledgeable.
To render each XML File with a custom XSLT Transform, the examples use an Html Page called “Default.htm”:
Figure 1 The Html Wrapper used to display XML/XSLT (Default.htm) via the “href” attribute in the anchor tag.
Note: The individual files (demo01.xml, demo02.xml, and demo03.xml) may be rendered/displayed directly in Internet Explorer by right-clicking on the XML File. The browser will render the transformed HTML.
The HTML simply references the XML files from three anchor tags. The XML Files, in turn, call the specific XSLT File on the second line. (There is some eye-candy in the form of a cute airplane banner, Site Title and a menu formatted by some CSS and images. These can be safely ignored.)
The following shows the first example,”Demo 1”, in its entirety:
Figure 2 Basic "Hello World" XML
Figure 3 First Simple XSLT Code
Figure 4 Output of a Simple XSLT Transform
(Note: the Banner originates from the Html Wrapper which includes the top menu.)
The first two examples, “Demo 1” and “Demo 2”, do not use XML Namespaces in the XSLT Code and the XML pages can be edited from Notepad or Notepad++ editor.
(Notepad++ has a nice feature to render the XML in several different browsers—if they are installed on your machine. Ted actually uses Visual Studio 2010 to edit the files for the added benefit of using its Intellisense. The XSLT code, in these first two examples, is not complex and Notepad will do fine for these.)
The next example, “Demo 2”, displays a simple phone list formatted by an XSLT Transform.
Figure 5 Second Simple XSLT Transform
(Code Not Shown in Article)
The third example, “Demo 3”, is a much more complex form and uses an XML Namespace in the XSLT Code:
Figure 6 Third example with a markedly more complex XSLT Transform
(Note: Header from HTML Wrapper is Not Displayed and the Code is Not Shown in Article)
Ted’s purpose in the last example is not to completely explain the complex XSLT. His aim is more to give the student a working example of XSLT capability they can take apart, examine, experiment with, copy and use.
An interesting exercise for the reader is to make the third example work without the XML Namespace. This gives insight to the use of XML Namespaces.
This concludes the basic XML and XSLT Transforms. Part II will continue with XML Web Viewer.