Paul Harouff - 2019-07-03

Wow. That got completely mangled. Let's try again with code blocks. I don't see any way to edit the original post. Sorry for that.

XML Tools appears to be ignoring the disable-output-encoding attribute when running a transformation of an XML file with an XSL file.

My xsl:output is set to method="text". I am actually generating a MHT file to open in MS Word.

If I have an XML element
<TEXT>&lt;test string 2&gt;</TEXT>
and my XSL transformation is outputting
<xsl:text>&lt;test string 1&gt; </xsl:text><xsl:value-of select="TEXT"/>
the result is
&lt;test string 1&gt;<test string 2>
and the <test string 2> in the MHTML output causes Word to ignore the entire paragraph.

If I change the XML element to
<TEXT>&amp;lt;test string 2&amp;gt;</TEXT>
the result is
&lt;test string 1&gt;&amp;lt;test string 2&amp;gt;
and when I open the file in Word, the result is
<test string 1> &amp;lt;test string 2&amp;gt;
which is gobbledygook to the reader.

I have spent an entire day trying to get XML Tools to transform the TEXT element to output
&lt;test string 1&gt; &lt;test string 2&gt;
so that when I open the file in Word the result is
<test string 1> <test string 2>

I've tried every combination I can think of using <xsl:value-of disable-output-encoding="yes"> and <xsl:text disable-output-encoding="yes"> with no luck. Even the brute force method of <xsl:text disable-output-encoding="yes"><[CDATA[&]]></xsl:text> transforms to &amp; when it should be just &.

I can't figure out a work-around solution.

 

Last edit: Paul Harouff 2019-07-03