473,545 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XslCompiledTran sform behaves differently than XslTransform

Hello.

I'm in the midst of moving a web application from ASP.NET 1.1 to
ASP.NET 2.0 (framework 3.0), and as part of this move, I am told by
Visual Studio that the XslTransform object is now deprecated, and I
should use XslCompiledTran sform. For the most part changing to this
object works fine, however I have noticed in some cases a difference
of behavior that breaks the proper running of my app.

I am using XSL templates to transform XML into HTML to be outputted to
the browser, and in some of my templates I have HTML "script" tags,
like so:

<script ...></script>

Using the old XslTransform object, this was handled just fine.
However, using the new XslCompiledTran sform object, instances of these
script tags are reduced to single-tag versions in the output, like so:

<script ... />

Since this syntax is currently not valid HTML, browsers are not
correctly handling this output, and I get lots of javascript errors
and display problems.

Is this expected behavior by the new XslCompiledTran sform object? Is
there any way to prevent it from doing this, or do I just need to keep
using the deprecated XslTransform instead?

Thanks!

--Steve
Mar 4 '08 #1
2 3436
st***********@g mail.com wrote:
I am using XSL templates to transform XML into HTML to be outputted to
the browser, and in some of my templates I have HTML "script" tags,
like so:

<script ...></script>

Using the old XslTransform object, this was handled just fine.
However, using the new XslCompiledTran sform object, instances of these
script tags are reduced to single-tag versions in the output, like so:

<script ... />
Make sure your stylesheet has
<xsl:output method="html"/>
and that script element is in no namespace.

If you still have problems then show us how you use XslCompiledTran sform
exactly, you might need to make sure you use the OutputSettings property
of XslCompiledTran sform:
<URL:http://msdn2.microsoft .com/en-us/library/System.Xml.Xsl. XslCompiledTran sform.OutputSet tings.aspx>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 4 '08 #2
On Mar 4, 11:38 am, Martin Honnen <mahotr...@yaho o.dewrote:
steve.nick...@g mail.com wrote:
I am using XSL templates to transform XML into HTML to be outputted to
the browser, and in some of my templates I have HTML "script" tags,
like so:
<script ...></script>
Using the old XslTransform object, this was handled just fine.
However, using the new XslCompiledTran sform object, instances of these
script tags are reduced to single-tag versions in the output, like so:
<script ... />

Make sure your stylesheet has
<xsl:output method="html"/>
and that script element is in no namespace.
Adding the xsl:output tag fixed the problem.

Thanks!

--Steve
Mar 5 '08 #3

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

Similar topics

3
4185
by: Eckhard Schwabe | last post by:
when switching from the old "XslTransform " to "XslCompiledTransform" I notice a difference in the handling of whitespace. I need to transform a XML file which contain tabs (\t), and which remain untouched when I use XslTransform to do the transformation. But after switching to XslCompiledTransform the tabs are transformed to a single space...
0
1203
by: Matt | last post by:
With VS2005 I see that the XslTransform class has been deprecated and XslCompiledTransform has replaced it. I am having issues with trying to get the new class to work how it did with the old. I would appreciate if someone could tell me how to replace the following code with the new class. Mainly, I just don't know how to pass my evidence...
1
2598
by: Steve | last post by:
Using VB.NET 2.0 I have a simple routine that attempts transforms an XmlDocument with an XSLT stylesheet into HTML. Under the old 1.1 framework with XslTransform, everything worked fine. Now using XslCompiledTransform, the Transform method hangs. My code: Function TransformXML(ByRef FacXML As Xml.XmlDocument, ByVal XslFile As String) As...
6
8085
by: W. Jordan | last post by:
Hello there, Are there anybody who is using the XslCompiledTransform that comes with .net framework, which was said to be a replacement of the XslTransform class? I found that the class has some issues when the xsl file contains scripts. The XslCompiledTransform uses the CodeDom to compile the scripts within the xsl file into .net...
1
496
by: Sunday Oke | last post by:
Hi folks I have this code which basically transforms a recordset retrieved from a oracle database. With the XslTransform class being deprecated I have tried to use the XslCompiledTransform class instead to get the same result, but to no avail. Please help XmlDataDocument xmlDoc = new XmlDataDocument(dsExport); //dsExport is my dataset
12
10069
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b) ..... // xsl contents abc.aspx?p1=v1&amp;p2=<xsl:value-of select="$v2" />
3
5442
by: Andy Fish | last post by:
Hi, From reading the documentation, I get the impression that XslCompiledTransform should be faster than XslTransform on my test with a large complex document and a large complex XSLT, the transform took 4 minutes with XslTransform but 7 minutes with XslCompiledTransform. However, with the same stylesheet on another large complex...
1
1638
by: =?Utf-8?B?Vmlub2Q=?= | last post by:
Hi, I am having a problem doing the transform. Actually i am migrating the code from XslTranform class into XslCompiledTransform class. Here is the code that i am using in .net 1.1 private void DoTransform(ref XslTransform arrTransformations, ref XmlDocument objSource,
0
1231
by: bryhi | last post by:
Here is the code you can past in your console application to see the differences. I need to know how to get this to work correctly. #pragma warning disable // because we are using a depricated object static void Main(string args) { /* * There are two problems: * 1. The characters (CRLF) are not being output by the new object. * 2....
0
7486
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7676
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7932
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7776
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6001
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5347
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1905
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.