LiveSite XSL Reference

2 July 2008
by Gavin Colborne

The idea with this page is to capture all the useful LiveSite XSL syntax for use in the Appearance XSL of a component. This way you can be lazy 🙂

Select Values

Select a basic datum:
<xsl:value-of select=”/Properties/Data/Datum[@Name=’Message’]”/>

Admin Switch

This is used in the component to determine if it is being viewed from within TeamSite or the LiveSite runtime.
When “Admin=true” the component is being viewed in TeamSite.
<xsl:choose>
<xsl:when test=”/Properties[@Admin=’true’]”>
<h1>Hello I am being viewed in TeamSite</h1>
</xsl:when>
<xsl:otherwise>
<h1> Hello I am being viewed on the Runtime server</h1>
</xsl:otherwise>
</xsl:choose>

Create a Variable

<xsl:variable name=”branchName” select=”/Properties/Data/External/branch”/>

Reference a variable

<xsl:value-of select=”$branchName”/>

Write a Comment

<xsl:comment>Start SSI</xsl:comment>

Text

<xsl:text disable-output-escaping = “yes”>my text</xsl:text>

CDATA – can never remember this 🙂

<![CDATA[ ]]>

Write Include Tag

<xsl:text disable-output-escaping = “yes”>
<jsp:include page=”ShowDCR.jsp”></jsp:include>
</xsl:text>

Create a Hyperlink

<li>
<a>
<xsl:attribute name=”href”>
<xsl:text>$URL_PREFIX/</xsl:text>
<xsl:value-of select=”/Properties/Data/Datum[@Name=’Link Target’]”/>
</xsl:attribute>
<xsl:value-of select=”/Properties/Data/Datum[@Name=’Link Title’]”/>
</a>
</li>

Our Latest News