BASICS

ADMINISTRATION

DEVELOPMENT

SUPER ADMIN

  LAST UPDATED
10/20/2012

XSL Reference

Gathered on this page are a few of the most common XSL snippets used by the OmniUpdate support team.

Example PCF

The following is an example PCF file that we will be making reference to with the XSL tags mentioned on this page.

<document>
<title>Gallena University</title>
<content>
<!-- com.omniupdate.div label="content" group="Everyone" button="707" -->
<p>This is some example content.</p>
<!-- /com.omniupdate.div -->
</content>
</document>		

xsl:value-of

XSL:Value-of makes it easy to extract text based content from a PCF file. If you need access to simple text based content, this is the best tag to use.

<xsl:value-of select="document/title" />		

The above code example should return: "Gallena University"


xsl:copy-of

XSL:Copy-of allows you to pull in the complete XML node of any node within the PCF. It is also currently the only way to get HTML comments stored in your PCF to display. XSL:Value-of strips out any HTML comments found in content pulled from the PCF and just displays text.

<xsl:copy-of select="document/content/node()" />		

The above could should output the following:

<!-- com.omniupdate.div label="content" group="Everyone" button="707" -->
<p>This is some example content.</p>
<!-- /com.omniupdate.div -->		

xsl:choose

XSL:Choose is essentially the equivalent of an IF ELSE statement in other programming languages. It will allow you to make strategic decisions about how to display your XSL output using the content obtained from the PCF.

<xsl:choose>
<xsl:when test="document/title">
<xsl:value-of select="document/title" />
</xsl:when>
<xsl:otherwise>
There was no title node in the PCF, so this message will be displayed instead.
</xsl:otherwise>
</xsl:choose>		

Was this page helpful?

Additional Comments:


(Include your email address if you would like a reply)

Procede to http://support.omniupdate.com/