Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-38082

Web Content Templates cannot be made with XSL script

    Details

    • Story Points:
      1
    • Fix Priority:
      4

      Description

      Steps to reproduce:

      1. In Control Panel > Web Content, Add a Structure with a Text field 'Title' and a Text Box field 'Body'
      2. Add a Template, selecting the Structure
        • Click Launch Editor and replace the contents with the following:
          <?xml version="1.0"?>
          
          <xsl:stylesheet
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"     
              xmlns:date="http://exslt.org/dates-and-times"     
              xmlns:dyn="http://exslt.org/dynamic"     
              xmlns:exsl="http://exslt.org/common"     
              xmlns:func="http://exslt.org/functions"     
              xmlns:math="http://exslt.org/math"
              xmlns:random="http://exslt.org/random"     
              xmlns:regexp="http://exslt.org/regular-expressions"     
              xmlns:set="http://exslt.org/sets"     
              xmlns:str="http://exslt.org/strings"     
              xmlns:xalan="http://xml.apache.org/xalan"      
              exclude-result-prefixes="xalan"
              extension-element-prefixes="date dyn exsl func math random regexp set str xalan">
              <xsl:output method="html" omit-xml-declaration="yes"/>
              <xsl:template match="/">
              <xsl:value-of disable-output-escaping="yes" select="root/dynamic-element[@name='Title']/dynamic-content"/>
              <br/>
              <p>
              <xsl:value-of disable-output-escaping="yes" select="root/dynamic-element[@name='Body']/dynamic-content"/> 
              </p>
              </xsl:template>
          </xsl:stylesheet>
          
      1. Update > Save > Add a WC of that created Structure type, putting something in each field.
      2. Add a Web Content Display portlet to a page
      3. Select the WC

      Expected result:
      User will be able to see the Web Content made with a Template written in XSL script.

      Actual result:
      User is not able to see the Web Content--it's just a blank area where the WC would go (no console errors display, though). But if the user changes the script to the following it will display fine.

      <p>$Title.getData()</p>
      <p>$Body.getData()</p>
      

        Attachments

        1. 6.2.jpg
          6.2.jpg
          9 kB
        2. 7.0.jpg
          7.0.jpg
          23 kB
        3. master.jpg
          master.jpg
          15 kB

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                3 years, 9 weeks, 4 days ago

                Packages

                Version Package