AnsweredAssumed Answered

disable-output-escaping issue - webforms

Question asked by jayagopalan on Apr 11, 2009
Hi,
    While using webforms to capture meta-tags in webform, the xsl tranform generates special characters like these,
<br /> in the HTML.

Is there a way to avoid these specail characters in the HTML output generated by XSL. I have tried using disable-out-put-escaping="yes" but still it doesn't work.

Web form XSD :
<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
         <xs:element name="general">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="metadata">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="title" type="xs:string"/>
                        <xs:element name="description" type="xs:string"/>
                        <xs:element name="keywords" type="xs:string"/>
                        <xs:element name="language" type="xs:string"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element> 
              </xs:sequence>
          </xs:complexType>
        </xs:element>
</xs:schema>

Web form XSL :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:general="http://www.alfresco.org/alfresco/general">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <!– TODO customize transformation rules
         syntax recommendation http://www.w3.org/TR/xslt
    –>
    <xsl:template match="/">      
        <head xsl:exclude-result-prefixes="generall">
            <title><xsl:value-of select="/general/metadata/title" disable-output-escaping="yes" /></title>
            <meta name="description">
                <xsl:attribute name="content">
                    <xsl:value-of select="/general/metadata/description" disable-output-escaping="yes" />
                </xsl:attribute>
            </meta>
            <meta name="keywords">
                <xsl:attribute name="content">
                    <xsl:value-of select="/general/metadata/keywords" disable-output-escaping="yes" />
                </xsl:attribute>
            </meta>
            <meta http-equiv="content-language">
                 <xsl:attribute name="content">
                    <xsl:value-of select="/general/metadata/language" disable-output-escaping="yes" />
                </xsl:attribute>
            </meta>
        </head>                
    </xsl:template>
</xsl:stylesheet>

How can this be fixed ?

Thanks
Jay

Outcomes