Skip to content

Instantly share code, notes, and snippets.

@spdustin
spdustin / highcharts_5.xsl
Created July 10, 2015 22:02
Highcharts (with params and improved csv)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="xAxis">Date</xsl:param>
<xsl:param name="Series1">Total</xsl:param>
<xsl:param name="Series2">Subtotal</xsl:param>
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
<div id="container2" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
<script type="text/javascript">
@spdustin
spdustin / highcharts_4.xsl
Created July 10, 2015 21:37
Highcharts, part 4 (multiple series)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
<div id="container2" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
<script type="text/javascript">
<![CDATA[
$('#container').highcharts({
chart: {
@spdustin
spdustin / highcharts_part3.xsl
Created July 10, 2015 16:36
Highcharts (bar chart and pie chart)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
<div id="container2" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
<script type="text/javascript">
<![CDATA[
$('#container').highcharts({
chart: {
@spdustin
spdustin / highcharts_a.xsl
Created July 9, 2015 19:46
Highcharts (pre-updatepanel)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:strip-space elements="script"/>
<xsl:template match="/">
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"/>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
<script type="text/javascript">
@spdustin
spdustin / faq_redux.xsl
Created July 9, 2015 19:18
Updated Expanding/Collapsing FAQ (with wpclick killer)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="WPQ"/>
<!-- This XSL Stylesheet created by SharePoint Experts, Inc. -->
<!-- http://sharepointexperience.com -->
<xsl:output method="html" indent="yes"/>
<!-- This template is the "wrapper" or "container" for the custom view. -->
<xsl:template match="/">
<!-- This is the actual wrapper element that will be emitted -->
<dl class="faq">
<!-- This will tell the data view to look for the actual content
@spdustin
spdustin / faq.xsl
Created July 9, 2015 16:49
FAQs (expanding and collapsing)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- This XSL Stylesheet created by SharePoint Experts, Inc. -->
<!-- http://sharepointexperience.com -->
<xsl:output method="html" indent="yes"/>
<!-- This template is the "wrapper" or "container" for the custom view. -->
<xsl:template match="/">
<!-- This is the actual wrapper element that will be emitted -->
@spdustin
spdustin / announcements.xsl
Created July 8, 2015 21:12
Accordion Announcements
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="WPQ"/>
<xsl:param name="ListTitle"/>
<!-- This XSL Stylesheet created by SharePoint Experts, Inc. -->
<!-- http://sharepointexperience.com -->
<xsl:output method="html" indent="yes"/>
<!-- This template is the "wrapper" or "container" for the custom view. -->
<xsl:template match="/">
@spdustin
spdustin / baseline_dvwp.xsl
Created July 8, 2015 20:00
Baseline DVWP XSL
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- This XSL Stylesheet created by SharePoint Experts, Inc. -->
<!-- http://sharepointexperience.com -->
<xsl:output method="html" indent="yes"/>
<!-- This template is the "wrapper" or "container" for the custom view. -->
<xsl:template match="/">
<!-- This is the actual wrapper element that will be emitted -->
@spdustin
spdustin / announcements_grouped_by_year.xsl
Created July 7, 2015 20:01
XSL Example - Group by year from "date"
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:key name="group-by-group" match="Row" use="@Group"/>
<xsl:key name="group-by-year" match="Row" use="substring(@date,4,4)"/>
<xsl:template match="/">
<ul>
<xsl:apply-templates select="/dsQueryResponse/Rows/Row[count(. | key('group-by-year', substring(@date,4,4))[1]) = 1]" mode="header">
<xsl:sort select="substring(@date,4,4)"/>
</xsl:apply-templates>
</ul>
@spdustin
spdustin / announcements_grouped.xsl
Created July 7, 2015 20:00
XSL Example - Group By "Group"
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:key name="group-by-group" match="Row" use="@Group"/>
<xsl:template match="/">
<xsl:apply-templates select="/dsQueryResponse/Rows/Row[count(. | key('group-by-group', @Group)[1]) = 1]" mode="header">
<xsl:sort select="@Group"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="Row" mode="header">
<h1><xsl:value-of select="@Group"/></h1>