473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

<xsl:text disable-output-escaping="yes"> does not work in XslCompi

Jon
Hi,

I used XslCompiledTransform with the following Xsl file. The <xsl:text
disable-output-escaping="yes"does not work when using XslCompiledTransform
to do the trnasform (namely the output contain < not <), while it works when
using MSXML2 to do the transform. Does anyone have the same problem and how
to make the escape work? Thanks.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<port1 id="Common.Javascripts" version="$Revision: 8 $">
<port2>
<xsl:text disable-output-escaping="yes"><![CDATA[>
<object name="FileIO" classid="clsid:6F745082-4C31-4ADE-B83A-5B16C16BF86F"
codebase="scripts/bin/rwhelpers.dll#version=1,1,0,9"></object>
<script language="Javascript" src="scripts/ErrorHandler.js"</script>
]]></xsl:text>
</port2>
</port1>
</xsl:template>
</xsl:stylesheet>
Sep 11 '06 #1
4 9128
Does anyone have the same problem and how
to make the escape work? Thanks.
From the XSLT 1.0 Spec http://www.w3.org/TR/xslt#disable-output-escaping :

"Since disabling output escaping may not work with all XSLT processors and
can result in XML that is not well-formed, it should be used only when there
is no alternative."

So an XSLT processor is not required to support d-o-e.

The real problem described in the original post is to *stop* using d-o-e.

Cheers,
Dimitre Novatchev.
"Jon" <Jo*@discussions.microsoft.comwrote in message
news:B1**********************************@microsof t.com...
Hi,

I used XslCompiledTransform with the following Xsl file. The <xsl:text
disable-output-escaping="yes"does not work when using
XslCompiledTransform
to do the trnasform (namely the output contain < not <), while it works
when
using MSXML2 to do the transform. Does anyone have the same problem and
how
to make the escape work? Thanks.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<port1 id="Common.Javascripts" version="$Revision: 8 $">
<port2>
<xsl:text disable-output-escaping="yes"><![CDATA[>
<object name="FileIO" classid="clsid:6F745082-4C31-4ADE-B83A-5B16C16BF86F"
codebase="scripts/bin/rwhelpers.dll#version=1,1,0,9"></object>
<script language="Javascript" src="scripts/ErrorHandler.js"</script>
]]></xsl:text>
</port2>
</port1>
</xsl:template>
</xsl:stylesheet>

Sep 12 '06 #2


Jon wrote:

I used XslCompiledTransform with the following Xsl file. The <xsl:text
disable-output-escaping="yes"does not work when using XslCompiledTransform
to do the trnasform (namely the output contain < not <),
How exactly do you use XslCompiledTransform? Can you show us the exact
call of the Transform method you use and the exact type of the
parameters used with the Transform method?
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Sep 12 '06 #3
Jon
I found out the reason from MSDN. Here is the words from MSDN:
'The <xsl:text disable-output-escapingtag is used to indicate whether or
not special characters need to be escaped into an XML form (for example,
using <&ltin place of the "<" symbol) or left in the present condition. The
disable-output-escaping attribute is ignored when transforming to an
XmlReader or XmlWriter object and has no effect on special characters.'

Since output XmlWriter does not respect 'disable-output-escaping', I use
'MemoryStream' instead and it does respect 'disable-output-escaping' but it
strip all my whitespaces. Now I have problem with whitespaces. Does anyone
know how to keep whitespaces in Xslt files when using 'Stream' as transform
output. Thanks.

"Martin Honnen" wrote:
>

Jon wrote:

I used XslCompiledTransform with the following Xsl file. The <xsl:text
disable-output-escaping="yes"does not work when using XslCompiledTransform
to do the trnasform (namely the output contain < not <),

How exactly do you use XslCompiledTransform? Can you show us the exact
call of the Transform method you use and the exact type of the
parameters used with the Transform method?
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Sep 12 '06 #4
Hi,

I used XslCompiledTransform with the following Xsl file. The <xsl:text
disable-output-escaping="yes"does not work when using XslCompiledTransform
to do the trnasform (namely the output contain < not <), while it works when
using MSXML2 to do the transform. Does anyone have the same problem and how
to make the escape work? Thanks.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<port1 id="Common.Javascripts" version="$Revision: 8 $">
<port2>
<xsl:text disable-output-escaping="yes"><![CDATA[>
<object name="FileIO" classid="clsid:6F745082-4C31-4ADE-B83A-5B16C16BF86F"
codebase="scripts/bin/rwhelpers.dll#version=1,1,0,9"></object>
<script language="Javascript" src="scripts/ErrorHandler.js"</script>
]]></xsl:text>
</port2>
</port1>
</xsl:template>
</xsl:stylesheet>
Hi,

I encountered the same problem with the XslTransform and XmlTextWriter. Instean of using a MemoryStream, I've just used a StreamWriter which wrote out exactly what I was after with no escaped characters.

I would say that this problem comes up, because the XmlTextWriter will transform anything inside a node to it's escaped version, so as to make a well formed XML document. Since I'm using XSL to generate code, that's not a problem that I am going to face.

Dave

Posted from http://www.topxml.com/renntp using reNNTP: the website based NNTP reader.
Oct 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Simon Brooke | last post by:
Here's my problem: <xsl:template match="/category"> .... <script type="text/javascript"> &lt;!]&gt; </script> .... </xsl:template>
2
by: riceyeh | last post by:
Hi, What does <xsl:if test="not($values)"mean? What I do not understand is $values? Here, means array? And . = $value means current node is equal to the variable value? So the total meaning is...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.