xslt-processor icon indicating copy to clipboard operation
xslt-processor copied to clipboard

does not obey 'disable-output-escaping'=yes

Open jpmorris opened this issue 6 years ago • 1 comments

I want to turn xml into html. I want to have <!DOCTYPE html> to start the file. Tthe following works with other xml/xsl converters:

xsl:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="yes"/>
    <xsl:template match="/">
        <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;</xsl:text>
    </xsl:template>
    </xsl:output>
</xsl:stylesheet>

However this module doesn't properly render the DOCTTYPE tag. I get:

&amp;lt;!DOCTYPE html&amp;gt;

So 'disable-output-escaping' isn't being honored because it converts '&' to '& also it does't properly convert < to '<' (but this might be do to the escaping issue).

jpmorris avatar Sep 24 '19 19:09 jpmorris

There seems to be code to specifically escape all output which isnt what i want either as I am converting XML to TSV and need to keep my tabs etc

danpetitt avatar Jan 29 '20 11:01 danpetitt

I will note that disable-output-escaping is an optional feature of the XSLT 1.0 specification; however this does not discount the validity of this issue. I will also note that XSL 1.0 outputs a valid HTML5 doctype legacy string if you instead use <xsl:output method="html" doctype-system="about:legacy-compat"/> (which is also unsupported by xslt-processor), but there are other cases in which disable-output-escaping may be wanted.

mincerafter42 avatar Jun 15 '23 02:06 mincerafter42