XSL for Dummies

Aug 27, 2009 at 1:16 AM

Is it possible to see a view examples how to use xsl in your rotator web part.  I am not a programmer, but I am tech savy.  Any help would be greatly appreciated.

Aug 27, 2009 at 6:02 AM
Edited Aug 27, 2009 at 6:04 AM

Hi,

Unfortunately, this is not easy for someone without XSL experience.  Essentially, XSL can transform XML into HTML (WTF!?).  Our webpart will collate RSS feed data and the settings from the webpart and spit it out in XML.  The XML output can be seen by clicking "Show Raw Xml" in the webpart properties.  An example of this XML is shown below:

<WebcodaRssRotator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <RssFeedUrl>http://blog.sharepointsydney.com.au/syndication.axd</RssFeedUrl>

   <TotalFeedCount>5</TotalFeedCount>

   <NoItemsDisplay>3</NoItemsDisplay>

   <DescriptionSize>140</DescriptionSize>

   <LinkInNewWindow>false</LinkInNewWindow>

   <LinkRelativeUrl>false</LinkRelativeUrl>

   <DisplayDate>true</DisplayDate>

   <DisplayHeaderLink>false</DisplayHeaderLink>

   <rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">

      <channel>

         <title>SharePoint Sydney Blog</title>

         <description>It's a blog and it's about SharePoint. </description>

         <link>http://blog.sharepointsydney.com.au/</link>

         <docs>http://www.rssboard.org/rss-specification</docs>

         <generator>BlogEngine.NET 1.4.5.0</generator>

         <language>en-US</language>

         <blogChannel:blogRoll>http://blog.sharepointsydney.com.au/opml.axd</blogChannel:blogRoll>

         <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>

         <dc:creator>SharePoint Sydney</dc:creator>

         <dc:title>SharePoint Sydney Blog</dc:title>

         <item>

            <title>MySites Feature Stapling</title>

            <description>&lt;p&gt;I have recently used MySiteCreate 1.0 Production from Community Kit for SharePoint to apply a ... (shortened for brevity)</description>

            <link>http://blog.sharepointsydney.com.au/post/MySites-Feature-Stapling.aspx</link>

            <author>info.nospam@nospam.sharepointsydney.com.au (tal)</author>

            <comments>http://blog.sharepointsydney.com.au/post/MySites-Feature-Stapling.aspx#comment</comments>

            <guid>http://blog.sharepointsydney.com.au/post.aspx?id=e70f9e38-8ff9-4c1c-913a-66da966599c9</guid>

            <pubDate>Mon, 22 Jun 2009 10:54:40 +0400</pubDate>

            <dc:publisher>tal</dc:publisher>

            <pingback:server>http://blog.sharepointsydney.com.au/pingback.axd</pingback:server>

            <pingback:target>http://blog.sharepointsydney.com.au/post.aspx?id=e70f9e38-8ff9-4c1c-913a-66da966599c9</pingback:target>

            <slash:comments>0</slash:comments>

            <trackback:ping>http://blog.sharepointsydney.com.au/trackback.axd?id=e70f9e38-8ff9-4c1c-913a-66da966599c9</trackback:ping>

            <wfw:comment>http://blog.sharepointsydney.com.au/post/MySites-Feature-Stapling.aspx#comment</wfw:comment>

            <wfw:commentRss>http://blog.sharepointsydney.com.au/syndication.axd?post=e70f9e38-8ff9-4c1c-913a-66da966599c9</wfw:commentRss>

         </item>

      </channel>

   </rss>

</WebcodaRssRotator>

 

Then, any custom XSL that you've entered into the "Enter your custom XSL here:" box, will style the XML to spit out HTML.  The default view uses XSL that sits in 12\TEMPLATE\LAYOUTS\webcoda.rssrotator\RssRotator.xslt.  Have a look at that document to see how everything is done.  I know it's a lot to look at, but it'll at least it'll get you thinking.  There are loads of XSL tutorials online.  For example, have a look at www.w3schools.com/xsl/.

 

The easier way to go about restyling this webpart would be to edit the CSS file located at 12\TEMPLATE\LAYOUTS\webcoda.rssrotator\RssRotator.css.  This will prevent you from havving to create any XSL.

 

Hope I helped a little bit.

 

Sorry I couldn't be of much more help.