working on it ...


Explore Public Snippets

Sort by

Found 4 snippets

    public by cghersi  185245  1  6  1

    Use the Raw HTML content in XSLT transformations

    Usage of copy-of element allows to get the exact content of an XML node and put it as raw HTML, so that e.g. are not stripped out as instead happens with
    	Some text <br/> separated < br/> by new lines
    	<xsl:copy-of select="question"/>

    public by Percival  3220  0  6  1

    Usage of xsl:if operator in XSLT

    Simple yet effective example of xsl:if condition in templates and transformations
    <span style="color:ff8500;">
      <xsl:if test="@RefersTo = 'SomeValue'">
        <xsl:value-of select="@MyAttr"/>

    public by Crater  2805  0  6  0

    Usage of choose operator in XSLT

    This is a simple yet common use of choose operator for templates
      <xsl:when test="@RefersTo = 'Value'"> some normal text</xsl:when>
        <a style="text-decoration: none;">
          <xsl:attribute name="href">
            <xsl:value-of select="@myurl"/>
          <span> another text in the hyperlink</span>

    public by Casper  4036  0  7  3

    foreach construct in XSLT templates

    Simple example of a for each construct
    <xsl:for-each select="myXMLElem" >
        <xsl:text disable-output-escaping="yes">&amp;raquo;&amp;nbsp;</xsl:text>
        <a style="text-decoration: none; margin-left:0.5em;">
          <xsl:attribute name="href">
            <xsl:value-of select="@myAttrInXMLElem"/>
          <span><xsl:value-of select="@anotherAttr"/></span>

    List Complete ( 4 snippets total )

    • Public Snippets
    • Channels Snippets