include html file in xslt presentation template

Hi All,

 

xslt + DCR --generates : footer.html

 

xslt+ DCR -- generates : header.html

 

I want to include html files (header.html and footer.html ) in xslt presentation template + DCR (provides the center content) to generate the o/p html file having both header, footer and center content in the HTML o/p.

 

Please let me know how to get this done in teamsite (formpublisher).

 

 

thanks

 

Comments

  • That is a question you should ask Google

     

    In a short answer you have two choices.  create either another XSL rather than HTML (which is basically HTML  in the XSL wrapper),  or use an include. 

  • Thanks for response nipper

     

    but I want to include external HTML file (header.html and footer.html) in xslt presentation template to generate the o/p file in formpublisher.

     

    any sample xsl example.

  • try this

     

    <xsl:comment>#include virtual="/directory/included.html"</xsl:comment>

  •  

     

    I tried this  <xsl:comment>#include virtual="/directory/included.html"</xsl:comment> , but its not working...

  • Can you post your xsl code in short? what's the xslSmiley Surprisedutput?
  • xsl code ....

     

     

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:iw-association="com.interwoven.ui.formspub.utils.AssociationManager"
    extension-element-prefixes="iw-association">

    <xslSmiley Surprisedutput method="html"/>

    <xsl:template match="/">
    <link rel="stylesheet" type="text/css" href="/assets/css/mssb.css"/>
    <div class="mb_logo">
    <a id="lnkLogo" href="https://google.com/">
    <img src="/assets/images/mb_logo.gif" alt="google"
    title="google" border="0" /></a>
    </div>

    <xsl:apply-templates select="General/generic"/>

    <div id="footer">
    <span id="contentFooterHtml">
    <xsl:comment>#include virtual="/html/footer/cfooter.html" </xsl:comment>
    </span>
    </div>
    </xsl:template>

    <xsl:template match="generic">

    <xsl:if test="Headers!='' or header!=''">
    <xsl:for-each select="Headers">
    <xsl:choose>
    <xsl:when test="header-type='header1'">
    <div id="pageheader">
    <h1><xsl:value-of select="header" disable-output-escaping="yes"/></h1>
    </div>
    </xsl:when>
    <xsl:when test="header-type='header2'">
    <h2><xsl:value-of select="header" disable-output-escaping="yes"/></h2>
    </xsl:when>
    <xsl:when test="header-type='header3'">
    <h3><xsl:value-of select="header" disable-output-escaping="yes"/></h3>
    </xsl:when>
    <xsl:when test="header-type='header4'">
    <h4><xsl:value-of select="header" disable-output-escaping="yes"/></h4>
    </xsl:when>
    </xsl:choose>
    </xsl:for-each>
    </xsl:if>

    <xsl:if test="Paragraphs!='' or paragraph!=''">
    <xsl:for-each select="Paragraphs">
    <p class="bodytext">
    <xsl:value-of select="paragraph" disable-output-escaping="yes"/></p>
    </xsl:for-each>
    </xsl:if>

    </xsl:template>

    </xsl:stylesheet>

  • Looking for similar implementation, any updates on this post?

  • Hi, I suppose it is possible now unless xslt parser in TeamSite can parse the HTML tags.
    Below link by Microsoft for reference:
    https://learn.microsoft.com/en-us/previous-versions/troubleshoot/msxml/display-html-xsl-style-sheet

  • I would suggest a new post with what you have tried and we can offer assistance.

  • Thank you all! i was able to resolve it!

TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs