Skip to content

Instantly share code, notes, and snippets.

@s-e
Created January 30, 2012 22:44
Show Gist options
  • Save s-e/1707290 to your computer and use it in GitHub Desktop.
Save s-e/1707290 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<data>
<params>
<today>2012-01-30</today>
<current-time>22:13</current-time>
<this-year>2012</this-year>
<this-month>01</this-month>
<this-day>30</this-day>
<timezone>+00:00</timezone>
<website-name>Seddon Group</website-name>
<page-title>Case Studies Ajax Data</page-title>
<root>http://seddondev.electromediapreviews.co.uk</root>
<workspace>http://seddondev.electromediapreviews.co.uk/workspace</workspace>
<root-page>casestudymicro</root-page>
<current-page>cs-data</current-page>
<current-page-id>44</current-page-id>
<current-path>/casestudymicro/cs-data/flow/painting/show-all/midlands,national/show-all/?debug</current-path>
<parent-path>/casestudymicro</parent-path>
<current-url>http://seddondev.electromediapreviews.co.uk/casestudymicro/cs-data/flow/painting/show-all/midlands,national/show-all/?debug</current-url>
<upload-limit>10242880</upload-limit>
<symphony-version>2.2.5</symphony-version>
<output>flow</output>
<departmentname>painting</departmentname>
<market-sector>show-all</market-sector>
<region>midlands,national</region>
<misc>show-all</misc>
<cookie-username>Sam</cookie-username>
<cookie-pass>f54cc233f81a052e93b5a0beb160b18c43676811</cookie-pass>
</params>
<events />
<csms-entries-case-studies-all>
<section id="58" handle="entries-case-studies">Entries: Case Studies</section>
<entry id="1312">
<contract-value handle="£767267"> £767,267</contract-value>
<copy mode="formatted"><p>The provision of affordable housing doesn’t always mean new build.
Sometimes the solution can come from conversion or refurbishment of
existing property, but rarely with the challenges we faced at Lambs
House in Congleton.</p>
<p>This was a listed building with a long history, so we had to meet stringent
specifications and seek Conservation Officer Approvals. The works
comprised full refurbishment of the existing Grade 2 office building
to provide new ground floor offices with ancillary rooms in the
basement area - plus, conversion of the first and second floors into
further offices.</p>
<p>On these upper floors, we also created thirteen individual one bed en-suite
rooms which all had access to various communal facilities. These
provided attractive and affordable accommodation for people who would
otherwise have little chance of finding a decent place to live. In
short, offering a much needed ‘stepping stone’ to help them
eventually move on.</p>
<p>Apart from requiring all our experience in working on heritage sites, the
project was an opportunity for young people on our apprentice
programme to develop their skills and engage with the local
community.</p></copy>
<headline handle="respecting-history-creating-homes-that-people-can-afford">Respecting history, creating homes that people can afford </headline>
<images items="6">
<item id="1316">
<image size="170 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-24.jpg</filename>
<meta creation="2011-12-14T13:15:21+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="986" y1="36" y2="591" width="986" height="554" ratio="1.778" />
<description handle="lambs-house">Lambs House</description>
</item>
<item id="1313">
<image size="83 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-20.jpg</filename>
<meta creation="2011-12-14T13:13:07+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="986" y1="0" y2="554" width="986" height="554" ratio="1.778" />
<description handle="lambs-house">Lambs House</description>
</item>
<item id="1318">
<image size="256 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-28.jpg</filename>
<meta creation="2011-12-14T13:21:01+00:00" width="653" height="986" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="653" y1="40" y2="407" width="653" height="367" ratio="1.778" />
<description handle="lambs-house">Lambs House</description>
</item>
<item id="1314">
<image size="144 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-21.jpg</filename>
<meta creation="2011-12-14T13:13:45+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="986" y1="8" y2="562" width="986" height="554" ratio="1.778" />
<description handle="lambs-house">Lambs House</description>
</item>
<item id="1315">
<image size="149 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-22.jpg</filename>
<meta creation="2011-12-14T13:14:31+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="986" y1="28" y2="582" width="986" height="554" ratio="1.778" />
<description handle="lambs-house">Lambs House</description>
</item>
<item id="1317">
<image size="164 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-27.jpg</filename>
<meta creation="2011-12-14T13:15:48+00:00" width="653" height="986" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="653" y1="111" y2="478" width="653" height="367" ratio="1.778" />
<description handle="lambs-house">Lambs House</description>
</item>
</images>
<market-sector>
<item id="1337" handle="housing" section-handle="filter-market-sector" section-name="Filter: Market Sector">Housing</item>
</market-sector>
<project-description handle="jct-intermediate-form-of-contract-with-contractors-design-portion-2005">JCT Intermediate Form of Contract with Contractors design portion 2005</project-description>
<project-name handle="lambs-house-congleton">Lambs House, Congleton</project-name>
<region>
<item id="1330" handle="north-west" section-handle="filter-region" section-name="Filter: Region">North West</item>
</region>
<service>
<item id="1336" handle="maintenance" section-handle="filter-service" section-name="Filter: Service">Maintenance</item>
</service>
<status handle="21-weeks">21 weeks</status>
</entry>
<entry id="1306">
<copy mode="formatted"><p>With its soaring clock tower a familiar landmark, Grantham’s Grade 2 listed Victorian town hall is home to the prestigious Guildhall Arts Centre. The building has a long and fascinating history, but had sadly started to show its age until a recent project set out to restore it to its original majesty.</p>
<p>This was an ideal subject for our highly specialised skills and experience in dealing with the sensitive treatment required in heritage projects. Throughout our own long history, we have passed down the time-honoured crafts and techniques to generation after generation of apprentices – giving us a fully-qualified workforce that is highly skilled in work of this nature.</p>
<p>The contract itself involved the painting and decorating of the magnificent staircase, hall and ballroom to bring back their original splendour. Externally, along with all painting and decoration we undertook refurbishment of the roof - and the famous clock tower that is the building’s crowning glory.</p></copy>
<headline handle="winding-the-clock-back-to-former-glory">Winding the clock back to former glory</headline>
<images items="5">
<item id="1311">
<image size="8.64 MB" path="/csms/images" type="image/jpeg">
<filename>spsl-grantham-sept11-13.jpg</filename>
<meta creation="2011-12-14T12:16:58+00:00" width="4928" height="3264" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="7" x2="4913" y1="450" y2="3207" width="4906" height="2757" ratio="1.778" />
<description handle="grantham-clock-tower">Grantham Clock Tower</description>
</item>
<item id="1307">
<image size="6.33 MB" path="/csms/images" type="image/jpeg">
<filename>spsl-grantham-sept11-01.jpg</filename>
<meta creation="2011-12-14T12:07:27+00:00" width="3264" height="4928" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="3259" y1="1645" y2="3478" width="3259" height="1832" ratio="1.778" />
<description handle="grantham-clock-tower">Grantham Clock Tower</description>
</item>
<item id="1308">
<image size="7.75 MB" path="/csms/images" type="image/jpeg">
<filename>spsl-grantham-sept11-04.jpg</filename>
<meta creation="2011-12-14T12:08:38+00:00" width="3264" height="4928" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="3264" y1="699" y2="2536" width="3264" height="1836" ratio="1.778" />
<description handle="grantham-clock-tower">Grantham Clock Tower</description>
</item>
<item id="1309">
<image size="7.48 MB" path="/csms/images" type="image/jpeg">
<filename>spsl-grantham-sept11-05.jpg</filename>
<meta creation="2011-12-14T12:09:37+00:00" width="4928" height="3264" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="140" x2="4737" y1="555" y2="3137" width="4597" height="2581" ratio="1.778" />
<description handle="grantham-clock-tower">Grantham Clock Tower</description>
</item>
<item id="1310">
<image size="8.17 MB" path="/csms/images" type="image/jpeg">
<filename>spsl-grantham-sept11-06.jpg</filename>
<meta creation="2011-12-14T12:15:59+00:00" width="3264" height="4928" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="3264" y1="1766" y2="3603" width="3264" height="1836" ratio="1.778" />
<description handle="grantham-clock-tower">Grantham Clock Tower</description>
</item>
</images>
<market-sector>
<item id="1339" handle="local-authorities" section-handle="filter-market-sector" section-name="Filter: Market Sector">Local Authorities</item>
<item id="1343" handle="heritage" section-handle="filter-market-sector" section-name="Filter: Market Sector">Heritage</item>
</market-sector>
<project-name handle="grantham-clock-tower">Grantham Clock Tower</project-name>
<region>
<item id="1329" handle="midlands" section-handle="filter-region" section-name="Filter: Region">Midlands</item>
</region>
<service>
<item id="1335" handle="painting" section-handle="filter-service" section-name="Filter: Service">Painting</item>
</service>
</entry>
<entry id="1303">
<client handle="university-of-edinburgh">University of Edinburgh</client>
<contract-value handle="£-35m-approx-over-a-3-year-period">£ 3.5M approx over a 3 year period</contract-value>
<copy mode="formatted"><p>We’ve enjoyed a long and successful relationship with this eminent
university, providing maintenance and redecoration not only to many
of its departments, but also to a wide range of student accommodation
within various campuses.</p>
<p>We are well experienced in working in universities, so we know the
importance of being able to deliver our services in line with
Edinburgh’s policies and procedures – working collaboratively
with their Estate Department to make sure we always comply with all
the relevant site rules and permissions. In doing so, we have been
able to develop a flexible completion schedule which maximises
productivity, but minimises any impact on staff or students.</p>
<p>We are also very aware of the need to be control costs. So we work
collaboratively with other contractors to ensure an efficient and
effective fit with key deliverable targets. It’s a working
methodology which is proven to reduce costs. For example, using one
shared external scaffolding to allow all contractors to carry out
window replacements, redecoration and roofing repairs.</p>
<p>Given that many of the university’s buildings have listed status, one of
the significant advantages we’ve brought to this contract is our
specialised experience on heritage projects. In collaboration with
our suppliers we are able to use materials that meet the original
specifications, but are legally compliant with current regulations.
For instance, replacing lead base paint with an acceptable
alternative.</p>
<p>We are
conserving the best of the past, with innovative solutions that look
to the future.</p></copy>
<headline handle="meeting-higher-expectations-in-higher-education">Meeting higher expectations in higher education</headline>
<images items="5">
<item id="1298">
<image size="84 KB" path="/csms/images" type="image/jpeg">
<filename>edinburgh_university.jpg</filename>
<meta creation="2011-12-13T15:57:47+00:00" width="500" height="372" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="500" y1="23" y2="304" width="500" height="281" ratio="1.778" />
<description handle="edinburgh-university">Edinburgh University</description>
</item>
<item id="1300">
<image size="1.98 MB" path="/csms/images" type="image/jpeg">
<filename>internal-decoration-to-main-stair-teviot-house-04.jpg</filename>
<meta creation="2011-12-13T15:59:45+00:00" width="3664" height="2748" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="3664" y1="492" y2="2554" width="3664" height="2062" ratio="1.778" />
<description handle="edinburgh-university">Edinburgh University</description>
</item>
<item id="1301">
<image size="2.65 MB" path="/csms/images" type="image/jpeg">
<filename>seddon-edinburgh-uni-041chp.jpg</filename>
<meta creation="2011-12-13T16:00:49+00:00" width="2962" height="2832" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="2962" y1="338" y2="2006" width="2962" height="1667" ratio="1.778" />
<description handle="edinburgh-university">Edinburgh University</description>
</item>
<item id="1302">
<image size="2.77 MB" path="/csms/images" type="image/jpeg">
<filename>seddon-edinburgh-uni-047chp.jpg</filename>
<meta creation="2011-12-13T16:02:08+00:00" width="3664" height="2757" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="3664" y1="575" y2="2636" width="3664" height="2061" ratio="1.778" />
<description handle="edinburgh-university">Edinburgh University</description>
</item>
<item id="1297">
<image size="349 KB" path="/csms/images" type="image/bmp">
<filename>298px-university_of_edinburgh_logo_svg.bmp</filename>
<meta creation="2011-12-13T15:56:53+00:00" />
</image>
<crop-flag>No</crop-flag>
<description handle="university-of-edinburgh-logo">University of Edinburgh Logo</description>
</item>
</images>
<market-sector>
<item id="1338" handle="education" section-handle="filter-market-sector" section-name="Filter: Market Sector">Education</item>
</market-sector>
<project-name handle="university-of-edinburgh">University of Edinburgh</project-name>
<region>
<item id="1329" handle="midlands" section-handle="filter-region" section-name="Filter: Region">Midlands</item>
</region>
<service>
<item id="1335" handle="painting" section-handle="filter-service" section-name="Filter: Service">Painting</item>
<item id="1336" handle="maintenance" section-handle="filter-service" section-name="Filter: Service">Maintenance</item>
</service>
</entry>
<entry id="1293">
<client handle="derby-university">Derby University</client>
<copy mode="formatted"><p>Flooded by natural light, the vast and airy Atrium is a 17,000 sq metre learning hub at located at the heart of Derby University. The focal point for students and teaching staff alike, it’s a great place for formal study, lively debates or simply relaxing with friends.</p>
<p>It’s equally alive outside of term time, when its 700 seat capacity makes it an ideal venue for other conferences and many other corporate events. All of which means there is never a hope of closing it while any work is carried out. However, we came up with a clever answer – carrying out this contract while the university was open, but working at night. In this way we were able to avoid disruption to the academic calendar, and minimise any inconvenience and Health &amp; Safety risks.</p>
<p>The project included the preparation and painting of the great web of exposed steelwork that vaults over the communal area of the Atrium. This posed its own particular set of problems, which we overcame with an innovative approach using mobile towers to give access to the ancillary steel trusses. Then, our skilled workforce could safely use their specialist skills to quickly complete the required task - and leave the Atrium looking forward to a long future at the centre of learning.</p></copy>
<headline handle="working-into-the-night-at-the-centre-of-learning">Working into the night at the centre of learning</headline>
<images items="5">
<item id="1287">
<image size="171 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-57.jpg</filename>
<meta creation="2011-12-13T11:21:36+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="986" y1="98" y2="653" width="986" height="554" ratio="1.778" />
<description handle="derby-university">Derby University</description>
</item>
<item id="1292">
<image size="147 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-58.jpg</filename>
<meta creation="2011-12-13T15:40:11+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="986" y1="45" y2="599" width="986" height="554" ratio="1.778" />
<description handle="derby-university-2">Derby University 2</description>
</item>
<item id="1294">
<image size="185 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-64.jpg</filename>
<meta creation="2011-12-13T15:44:23+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="986" y1="54" y2="609" width="986" height="554" ratio="1.778" />
<description handle="derby-university-3">Derby University 3</description>
</item>
<item id="1295">
<image size="174 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-67.jpg</filename>
<meta creation="2011-12-13T15:45:54+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="154" x2="939" y1="0" y2="440" width="784" height="440" ratio="1.778" />
<description handle="derby-university-4">Derby University 4</description>
</item>
<item id="1296">
<image size="125 KB" path="/csms/images" type="image/jpeg">
<filename>spsl-aug11-68.jpg</filename>
<meta creation="2011-12-13T15:48:55+00:00" width="986" height="653" />
</image>
<crop-flag>Yes</crop-flag>
<crop cropped="yes" x1="0" x2="986" y1="63" y2="617" width="986" height="554" ratio="1.778" />
<description handle="derby-university-5">Derby University 5</description>
</item>
</images>
<market-sector>
<item id="1338" handle="education" section-handle="filter-market-sector" section-name="Filter: Market Sector">Education</item>
</market-sector>
<organisation-role handle="pda-award-winner">PDA Award winner</organisation-role>
<project-description handle="internal-painting-and-decorating">Internal Painting and Decorating</project-description>
<project-name handle="derby-university">Derby University</project-name>
<region>
<item id="1329" handle="midlands" section-handle="filter-region" section-name="Filter: Region">Midlands</item>
</region>
<service>
<item id="1335" handle="painting" section-handle="filter-service" section-name="Filter: Service">Painting</item>
</service>
</entry>
<entry id="1291">
<client handle="anchor-housing-trust">Anchor Housing Trust</client>
<copy mode="formatted"><p>A leading provider of housing for the elderly, Anchor Trust has been
one of our most valued customers for many years. As a truly national
contractor, we can provide the full range of services that Anchor
requires in all regions of the country. Apart from the need to
provide cost-effective delivery of these services, we are always
conscious of the fact that we are working in the homes of elderly
people, and take this into account in all our planning and execution
of the work we carry out.</p></copy>
<headline handle="anchor-housing-trust">Anchor Housing Trust</headline>
<market-sector>
<item id="1337" handle="housing" section-handle="filter-market-sector" section-name="Filter: Market Sector">Housing</item>
</market-sector>
<project-name handle="anchor-housing-trust">Anchor Housing Trust</project-name>
<region>
<item id="1327" handle="national" section-handle="filter-region" section-name="Filter: Region">National</item>
</region>
<service>
<item id="1335" handle="painting" section-handle="filter-service" section-name="Filter: Service">Painting</item>
<item id="1336" handle="maintenance" section-handle="filter-service" section-name="Filter: Service">Maintenance</item>
</service>
<videos items="1">
<item id="1286">
<use-external-link>Yes</use-external-link>
<link handle="6su5n8rgtdg">6su5N8rgTdg</link>
<description handle="anchor-housing">Anchor Housing</description>
</item>
</videos>
</entry>
<entry id="1290">
<client handle="whitbread-plc">Whitbread Plc</client>
<copy mode="formatted"><p>This rolling national refurbishment project for Whitbread’s Premier Inn
brand is one of our biggest and most important contracts. Room
occupancy is obviously the critical factor in the hotel business, and
we have perfected a way of working that means a room can be ready for
guests within 24 hours – whether the work involved straightforward
redecoration or complete refurbishment. To ensure complete
satisfaction, we work closely with each hotel manager, and hold daily
consultations.</p></copy>
<headline handle="premier-inn-refurbishment">Premier Inn Refurbishment</headline>
<market-sector>
<item id="1341" handle="hotel-and-leisure" section-handle="filter-market-sector" section-name="Filter: Market Sector">Hotel and Leisure</item>
</market-sector>
<project-name handle="premier-inn-refurbishment">Premier Inn Refurbishment</project-name>
<region>
<item id="1327" handle="national" section-handle="filter-region" section-name="Filter: Region">National</item>
</region>
<service>
<item id="1335" handle="painting" section-handle="filter-service" section-name="Filter: Service">Painting</item>
<item id="1336" handle="maintenance" section-handle="filter-service" section-name="Filter: Service">Maintenance</item>
</service>
<videos items="1">
<item id="1285">
<use-external-link>Yes</use-external-link>
<link handle="bo2ot5lz3to">BO2OT5LZ3to</link>
<description handle="whitbread">Whitbread</description>
</item>
</videos>
</entry>
<entry id="1289">
<client handle="poole-housing">Poole Housing</client>
<copy mode="formatted"><p>We are currently into our third year of this 5 year contract and have
built an excellent working relationship with this customer. Apart
from delivering value and high quality results, the programme shows
our full commitment to our policy of Corporate Social Responsibility.
This includes recruiting local people to help boost employment and
career opportunities, achieving high scores in waste management and
recycling – and most importantly, consulting residents so we can
respond to their views.</p></copy>
<headline handle="poole-housing-partnership">Poole Housing Partnership</headline>
<market-sector>
<item id="1337" handle="housing" section-handle="filter-market-sector" section-name="Filter: Market Sector">Housing</item>
</market-sector>
<project-name handle="poole-housing-partnership">Poole Housing Partnership</project-name>
<region>
<item id="1331" handle="south-west" section-handle="filter-region" section-name="Filter: Region">South West</item>
</region>
<service>
<item id="1335" handle="painting" section-handle="filter-service" section-name="Filter: Service">Painting</item>
<item id="1336" handle="maintenance" section-handle="filter-service" section-name="Filter: Service">Maintenance</item>
</service>
<videos items="1">
<item id="1284">
<use-external-link>Yes</use-external-link>
<link handle="7ak3hpmje2u">7ak3HPmje2U</link>
<description handle="poole-housing-partnership">Poole Housing Partnership</description>
</item>
</videos>
</entry>
</csms-entries-case-studies-all>
</data>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">
<xsl:output method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
omit-xml-declaration="yes"
encoding="UTF-8"
indent="yes" />
<xsl:template match="/">
<xsl:variable name="region-list">
<xsl:call-template name="comma-list">
<xsl:with-param name="cstring" select="$region" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="market-sector-list">
<xsl:call-template name="comma-list">
<xsl:with-param name="cstring" select="$market-sector" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$misc = 'video-only'">
<xsl:choose>
<xsl:when test="$output='flow'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[videos/item]" mode="flow" />
</xsl:when>
<xsl:when test="$output='table'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[videos/item]" mode="table" />
</xsl:when>
<xsl:when test="$output='modals'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[videos/item]" mode="modals" />
</xsl:when>
<xsl:otherwise>
<h1>Please specify an output format</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$misc = 'featured'">
<xsl:choose>
<xsl:when test="$output='flow'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[featured='Yes']" mode="flow" />
</xsl:when>
<xsl:when test="$output='table'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[featured='Yes']" mode="table" />
</xsl:when>
<xsl:when test="$output='modals'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[featured='Yes']" mode="modals" />
</xsl:when>
<xsl:otherwise>
<h1>Please specify an output format</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$market-sector = 'show-all' and not($region = 'show-all') and $misc = 'show-all'">
<xsl:for-each select="exsl:node-set($region-list)/*">
<xsl:choose>
<xsl:when test="$output='flow'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[region/item/@handle = .]" mode="flow" />
</xsl:when>
<xsl:when test="$output='table'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[region/item/@handle = .]" mode="table" />
</xsl:when>
<xsl:when test="$output='modals'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[region/item/@handle = .]" mode="modals" />
</xsl:when>
<xsl:otherwise>
<h1>Please specify an output format</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<xsl:when test="not($market-sector = 'show-all') and $region = 'show-all' and $misc = 'show-all'">
<xsl:choose>
<xsl:when test="$output='flow'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[market-sector/item/@handle = $market-sector]" mode="flow" />
</xsl:when>
<xsl:when test="$output='table'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[market-sector/item/@handle = $market-sector]" mode="table" />
</xsl:when>
<xsl:when test="$output='modals'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[market-sector/item/@handle = $market-sector]" mode="modals" />
</xsl:when>
<xsl:otherwise>
<h1>Please specify an output format</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="not($market-sector = 'show-all') and not($region = 'show-all') and $misc = 'show-all'">
<xsl:choose>
<xsl:when test="$output='flow'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[market-sector/item/@handle = $market-sector and region/item/@handle = $region]" mode="flow" />
</xsl:when>
<xsl:when test="$output='table'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[market-sector/item/@handle = $market-sector and region/item/@handle = $region]" mode="table" />
</xsl:when>
<xsl:when test="$output='modals'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry[market-sector/item/@handle = $market-sector and region/item/@handle = $region]" mode="modals" />
</xsl:when>
<xsl:otherwise>
<h1>Please specify an output format</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$output='flow'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry" mode="flow" />
</xsl:when>
<xsl:when test="$output='table'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry" mode="table" />
</xsl:when>
<xsl:when test="$output='modals'">
<xsl:apply-templates select="/data/csms-entries-case-studies-all/entry" mode="modals" />
</xsl:when>
<xsl:otherwise>
<h1>Please specify an output format</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/data/csms-entries-case-studies-all/entry" mode="flow">
<h1>hit</h1>
<xsl:choose>
<xsl:when test="images/item">
<div class="item" rel="#modaldata{@id}" href="#" >
<!-- replace with crossfader, lightbox, gallery solution -->
<xsl:variable name="path-to-images" select="./images" />
<xsl:variable name="img-max-width" select="'250'" />
<xsl:choose>
<xsl:when test="$path-to-images/item/crop">
<img class="content" src="{$root}/image/4/{$path-to-images/item/crop/@width}/{$path-to-images/item/crop/@height}/{$path-to-images/item/crop/@x1}/{$path-to-images/item/crop/@y1}/{$img-max-width}/{round($img-max-width div $path-to-images/item/crop/@ratio)}{$path-to-images/item/image/@path}/{$path-to-images/item/image/filename}" alt="{$path-to-images/item/description}" title="{$path-to-images/item/description}" />
</xsl:when>
<xsl:otherwise>
<img class="content" src="{$workspace}{$path-to-images/item/image/@path}/{$path-to-images/item/image/filename}" alt="{$path-to-images/item/description}" width="{$path-to-images/item/image/meta/@width}" height="{$path-to-images/item/image/meta/@height}" />
</xsl:otherwise>
</xsl:choose>
<div class="caption"><xsl:value-of select="project-name" /></div>
</div>
</xsl:when>
<xsl:when test="videos/item">
<div class="item" href="#" rel="#modaldata{@id}">
<img class="content" src="http://img.youtube.com/vi/{videos/item[position()=1]/link}/0.jpg" />
<div class="caption"><xsl:value-of select="project-name" /></div>
</div>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/data/csms-entries-case-studies-all/entry" mode="table">
<div class="table-item">
<xsl:choose>
<xsl:when test="images/item">
<!-- replace with crossfader, lightbox, gallery solution -->
<xsl:variable name="path-to-images" select="./images" />
<xsl:variable name="img-max-width" select="'140'" />
<xsl:choose>
<xsl:when test="$path-to-images/item/crop">
<img src="{$root}/image/4/{$path-to-images/item/crop/@width}/{$path-to-images/item/crop/@height}/{$path-to-images/item/crop/@x1}/{$path-to-images/item/crop/@y1}/{$img-max-width}/{round($img-max-width div $path-to-images/item/crop/@ratio)}{$path-to-images/item/image/@path}/{$path-to-images/item/image/filename}" alt="{$path-to-images/item/description}" title="{$path-to-images/item/description}" />
</xsl:when>
<xsl:otherwise>
<img src="{$workspace}{$path-to-images/item/image/@path}/{$path-to-images/item/image/filename}" alt="{$path-to-images/item/description}" width="{$path-to-images/item/image/meta/@width}" height="{$path-to-images/item/image/meta/@height}" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="videos/item">
<img class="content" src="http://img.youtube.com/vi/{videos/item[position()=1]/link}/0.jpg" width="140" height="79"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<div class="table-click" rel="#modaldata{@id}"><h2>
<xsl:value-of select="project-name" />
</h2>
<h3>
<xsl:value-of select="headline" />
</h3>
<xsl:call-template name="truncate">
<xsl:with-param name="node" select="copy" />
<xsl:with-param name="limit" select="220" />
</xsl:call-template></div>
<div class="clear" />
</div>
</xsl:template>
<xsl:template match="/data/csms-entries-case-studies-all/entry" mode="modals">
<div class="modalwindow" id="modaldata{@id}" style="display:none">
<xsl:choose>
<xsl:when test="images/item">
<!-- replace with crossfader, lightbox, gallery solution -->
<xsl:variable name="path-to-images" select="./images" />
<xsl:variable name="img-max-width" select="'700'" />
<xsl:choose>
<xsl:when test="$path-to-images/item/crop">
<img src="{$root}/image/4/{$path-to-images/item/crop/@width}/{$path-to-images/item/crop/@height}/{$path-to-images/item/crop/@x1}/{$path-to-images/item/crop/@y1}/{$img-max-width}/{round($img-max-width div $path-to-images/item/crop/@ratio)}{$path-to-images/item/image/@path}/{$path-to-images/item/image/filename}" alt="{$path-to-images/item/description}" title="{$path-to-images/item/description}" />
</xsl:when>
<xsl:otherwise>
<img src="{$workspace}{$path-to-images/item/image/@path}/{$path-to-images/item/image/filename}" alt="{$path-to-images/item/description}" width="{$path-to-images/item/image/meta/@width}" height="{$path-to-images/item/image/meta/@height}" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="videos/item">
<iframe width="560" height="315" src="http://www.youtube.com/embed/{videos/item/link}?controls=0" frameborder="0" allowfullscreen="allowfullscreen"> </iframe>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<div>
<h2>
<xsl:value-of select="project-name" />
</h2>
<h3>
<xsl:value-of select="headline" />
</h3>
<div>
<xsl:call-template name="truncate">
<xsl:with-param name="node" select="copy" />
<xsl:with-param name="limit" select="250" />
</xsl:call-template>
<div class="read-more fright">
<a href="{$root}/casestudymicro/cs/{$departmentname}/{@id}">Read More</a>
</div>
</div>
</div>
</div>
</xsl:template>
<xsl:template name="comma-list">
<xsl:param name="cstring" />
<xsl:choose>
<xsl:when test="contains($cstring,',')">
<item><xsl:value-of select="substring-before($cstring,',')" /></item>
<xsl:call-template name="comma-list">
<xsl:with-param name="cstring" select="substring-after($cstring,',')" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:if test="string-length($cstring) &gt; 0">
<item><xsl:value-of select="$cstring" /></item>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="truncate">
<xsl:param name="node" />
<xsl:param name="limit" />
<!--
Append this to the end of the value, if we have truncated it.
-->
<xsl:param name="suffix" select="'&#x2026;'" />
<!--
Tolerance allows words that fall over the required length be
appended, as long as they don't go over $length + $tolerance.
-->
<xsl:param name="tolerance" select="3" />
<!--
Treat any of these characters as the end of a word.
-->
<xsl:param name="delimiters" select="str:tokenize(' -!?:)(;,.…&#x2013;&#x2014;&#160;', '')" />
<!-- Find actual limit -->
<xsl:variable name="limit">
<xsl:choose>
<xsl:when test="string-length($node) &lt;= $limit">
<xsl:value-of select="string-length($node)" />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="preceding-delimiter">
<xsl:call-template name="truncate-find-delimiter">
<xsl:with-param name="value">
<xsl:for-each select="str:tokenize(substring($node, 1, $limit + 1), '')">
<xsl:sort select="position()" data-type="number" order="descending" />
<xsl:value-of select="." />
</xsl:for-each>
</xsl:with-param>
<xsl:with-param name="delimiters" select="$delimiters" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="following-delimiter">
<xsl:call-template name="truncate-find-delimiter">
<xsl:with-param name="value" select="substring($node, $limit + 1)" />
<xsl:with-param name="delimiters" select="$delimiters" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$preceding-delimiter = 0 and $following-delimiter = 0">
<xsl:value-of select="$limit" />
</xsl:when>
<xsl:when test="$following-delimiter &lt;= $tolerance">
<xsl:value-of select="$limit + $following-delimiter" />
</xsl:when>
<xsl:when test="$preceding-delimiter &lt;= $tolerance">
<xsl:value-of select="$limit - $preceding-delimiter" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$limit" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Build output -->
<xsl:choose>
<xsl:when test="$limit != string-length($node)">
<xsl:apply-templates select="($node/* | $node/text())[1]" mode="truncate-search">
<xsl:with-param name="limit" select="$limit" />
<xsl:with-param name="suffix" select="$suffix" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$node/* | $node/text()" mode="truncate-render" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
Search for the node that runs over the limit.
-->
<xsl:template match="* | text()" mode="truncate-search">
<xsl:param name="length" select="0" />
<xsl:param name="limit" select="0" />
<xsl:param name="position" select="1" />
<xsl:param name="suffix" />
<xsl:variable name="next" select="(../* | ../text())[$position + 1]" />
<xsl:choose>
<!-- Limit found -->
<xsl:when test="$length + string-length(.) &gt;= $limit">
<xsl:choose>
<!-- Keep searching children -->
<xsl:when test="*">
<xsl:element name="{name()}">
<xsl:apply-templates select="@*" mode="truncate-render" />
<xsl:apply-templates select="(./* | ./text())[1]" mode="truncate-search">
<xsl:with-param name="length" select="$length" />
<xsl:with-param name="limit" select="$limit" />
<xsl:with-param name="suffix" select="$suffix" />
</xsl:apply-templates>
</xsl:element>
</xsl:when>
<!-- The node to truncate -->
<xsl:otherwise>
<xsl:apply-templates select="(../* | ../text())[position() &lt; $position]" mode="truncate-render" />
<xsl:apply-templates select="." mode="truncate-apply">
<xsl:with-param name="limit" select="$limit - $length" />
<xsl:with-param name="suffix" select="$suffix" />
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- Keep searching at this level -->
<xsl:when test="$next">
<xsl:apply-templates select="$next" mode="truncate-search">
<xsl:with-param name="length" select="$length + string-length(.)" />
<xsl:with-param name="limit" select="$limit" />
<xsl:with-param name="position" select="$position + 1" />
<xsl:with-param name="suffix" select="$suffix" />
</xsl:apply-templates>
</xsl:when>
<!-- Nothing to truncate -->
<xsl:otherwise>
<xsl:apply-templates select="../* | ../text()" mode="truncate-render" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
Apply truncation to node
-->
<xsl:template match="*" mode="truncate-apply">
<xsl:param name="limit" />
<xsl:param name="suffix" />
<xsl:element name="{name()}">
<xsl:apply-templates select="@*" mode="truncate-render" />
<xsl:value-of select="substring(., 1, $limit)" />
<xsl:value-of select="$suffix" />
</xsl:element>
</xsl:template>
<xsl:template match="text()" mode="truncate-apply">
<xsl:param name="limit" />
<xsl:param name="suffix" />
<xsl:value-of select="substring(., 1, $limit)" />
<xsl:value-of select="$suffix" />
</xsl:template>
<!--
Render all nodes
-->
<xsl:template match="*" mode="truncate-render">
<xsl:element name="{name()}">
<xsl:apply-templates select="@*" mode="truncate-render" />
<xsl:apply-templates select="* | text()" mode="truncate-render" />
</xsl:element>
</xsl:template>
<xsl:template match="@*" mode="truncate-render">
<xsl:attribute name="{name()}">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:template>
<xsl:template match="text()" mode="truncate-render">
<xsl:value-of select="." />
</xsl:template>
<!--
Search for a delimiter
-->
<xsl:template name="truncate-find-delimiter">
<xsl:param name="value" />
<xsl:param name="delimiters" />
<xsl:param name="length" select="0" />
<xsl:choose>
<xsl:when test="$value != ''">
<xsl:choose>
<xsl:when test="$delimiters[starts-with(substring($value, 1, 1), .)]">
<xsl:value-of select="$length" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="truncate-find-delimiter">
<xsl:with-param name="value" select="substring($value, 2)" />
<xsl:with-param name="delimiters" select="$delimiters" />
<xsl:with-param name="length" select="$length + 1" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$length" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment