Gathered on this page are a few of the most common XSL snippets used by the OmniUpdate support team.
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 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 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 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>