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><test string 2></text>", and my XSL transformation is outputting "<xsl:text><test string 1> </xsl:text><xsl:value-of select="TEXT">", the result is "<test string 1><test 2="" string="">". The <test 2="" string=""> in the MHTML output causes Word to ignore the entire paragraph.</test></test></xsl:value-of>
If I change the XML element to "<text><test string 2></text>", and my XSL transformation is outputting "<xsl:text><test string 1> </xsl:text><xsl:value-of select="TEXT">", the result is "<test string 1> <test string 2>". When I open the file in Word, the result is "<test 1="" string=""> <test string 2>" which is gobbledygook to the reader.</test></xsl:value-of>
I have spent an entire day trying to get XML Tools to output "<test string 1> <test string 2>" so that when I open the file in Word the result is "<test 1="" string=""> <test 2="" string="">". </test></test>
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 & when it should be just &. I can't figure out a work-around solution.</xsl:text></xsl:value-of>
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><test string 2></TEXT>
and my XSL transformation is outputting
<xsl:text><test string 1> </xsl:text><xsl:value-of select="TEXT"/>
the result is
<test string 1><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>&lt;test string 2&gt;</TEXT>
the result is
<test string 1>&lt;test string 2&gt;
and when I open the file in Word, the result is
<test string 1> &lt;test string 2&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
<test string 1> <test string 2>
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&
when it should be just&
.I can't figure out a work-around solution.
Last edit: Paul Harouff 2019-07-03