473,769 Members | 2,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Xml WebControl's Transform property in ASP.NET 2.0

We're in the process of migrating our projects to use VS2005 from
VS2003. We have a web page that uses the XML WebControl
(System.Web.UI. WebControls.Xml ) to perform an XSLT tranformation by
using the property "Transform" of the webcontrol. Here is a sample:

xmlMessage.Tran sform = _app.Cache.User MessagesXsltUse r;

'xmlMessage' is the XML Web Control, and
'_app.Cache.Use rMessagesXsltUs er' is the transformation to apply.

In .NET 1.1, the class of the transformation was XslTransform.
In .NET 2.0 this class has been deprecated by the new
XslCompiledTran sform class. However, the Xml Web control's
'Transform' property still takes an object of type 'XslTransform',
instead of the new class of 'XslCompiledTra nsform'.

How do I migrate the Xml web control's Transform property in .NET 2.0?
Is there a new version of the Xml Web Control with a Transform property
that takes an object of type XslCompiledTran sform?

Thanks!
--steve

Nov 19 '05 #1
7 3421
Any ideas?

--steve

Nov 19 '05 #2
I have lots of them, but not enough time to implement many of them.

I also have an idea that this refers to something you posted earlier,
perhaps in this thread. But my newsreader hides read messages, and it's too
much trouble for me to go looking for it.

;-)

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

<n3****@hotmail .com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Any ideas?

--steve

Nov 19 '05 #3
Kevin,

I'm lost, what are you getting at? I cross-posted the same question on
microsoft.publi c.dotnet.framew ork.aspnet.webc ontrols, is that what
you're talking about? At any rate, the question is still unanswered.

I'm surprised that if the XslTransform class is being deprecated in
..NET 2.0 by the XslCompiledTran sform class, that the XML webcontrol's
'Transform' property (System.Web.UI. WebControls.Xml ) does not at least
provide an overload to call it with new class.

I'm not asking you to provide with sample code, or implement any sort
of solution, just give me a pointer in the right direction.

In the meantime, I'm trying to refactor our code to get rid of the use
of the Xml webcontrol, and perform the transformation manually.

--steve

Nov 19 '05 #4
Hi steve,
I'm surprised that if the XslTransform class is being deprecated in
.NET 2.0 by the XslCompiledTran sform class, that the XML webcontrol's
'Transform' property (System.Web.UI. WebControls.Xml ) does not at least
provide an overload to call it with new class.
As to why it is being deprecated, read the following article from the msdn2
online library:

http://msdn2.microsoft.com/en-us/library/66f54faw.aspx

Why the "Transform" property is not overloaded, I can't say. I don't know
all the inner workings of the XML WebControl. It does seem like a good idea.
At any rate, the following msdn2 article indicates that you can use an
XslCompiledTran sform class to format the XML, and how to do it:

http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"n33470" <n3****@hotmail .com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com... Kevin,

I'm lost, what are you getting at? I cross-posted the same question on
microsoft.publi c.dotnet.framew ork.aspnet.webc ontrols, is that what
you're talking about? At any rate, the question is still unanswered.

I'm surprised that if the XslTransform class is being deprecated in
.NET 2.0 by the XslCompiledTran sform class, that the XML webcontrol's
'Transform' property (System.Web.UI. WebControls.Xml ) does not at least
provide an overload to call it with new class.

I'm not asking you to provide with sample code, or implement any sort
of solution, just give me a pointer in the right direction.

In the meantime, I'm trying to refactor our code to get rid of the use
of the Xml webcontrol, and perform the transformation manually.

--steve

Nov 19 '05 #5
Im having the same problem and I think this may be a bug. If you look at the
documentation for the Xml control it says:

"You can format the XML document with a System.Xml.Xsl. XslCompiledTran sform
object or with an XSL Transformation style sheet file by setting the
appropriate property."
Not that it says XslCompiledTran sform, but the Transform property is if Type
XslTransform.

Basically anybody that uses this control is screwed because you will get
errors telling you to use the XslCompiledTran sform but the Transform property
only takes an XlsTransform.

What is the workaround?

"Kevin Spencer" wrote:
Hi steve,
I'm surprised that if the XslTransform class is being deprecated in
.NET 2.0 by the XslCompiledTran sform class, that the XML webcontrol's
'Transform' property (System.Web.UI. WebControls.Xml ) does not at least
provide an overload to call it with new class.


As to why it is being deprecated, read the following article from the msdn2
online library:

http://msdn2.microsoft.com/en-us/library/66f54faw.aspx

Why the "Transform" property is not overloaded, I can't say. I don't know
all the inner workings of the XML WebControl. It does seem like a good idea.
At any rate, the following msdn2 article indicates that you can use an
XslCompiledTran sform class to format the XML, and how to do it:

http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"n33470" <n3****@hotmail .com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
Kevin,

I'm lost, what are you getting at? I cross-posted the same question on
microsoft.publi c.dotnet.framew ork.aspnet.webc ontrols, is that what
you're talking about? At any rate, the question is still unanswered.

I'm surprised that if the XslTransform class is being deprecated in
.NET 2.0 by the XslCompiledTran sform class, that the XML webcontrol's
'Transform' property (System.Web.UI. WebControls.Xml ) does not at least
provide an overload to call it with new class.

I'm not asking you to provide with sample code, or implement any sort
of solution, just give me a pointer in the right direction.

In the meantime, I'm trying to refactor our code to get rid of the use
of the Xml webcontrol, and perform the transformation manually.

--steve


Dec 15 '05 #6
The workaround for me was to get rid of the Xml web control completely.
Since we're just using it to transform an xml doc to html and then
dump the contents on a web page, I replaced the Xml web control with a
simple Literal control. Then, I just programmaticall y transform the
xml doc and put the result of the transformation (which for us is raw
html) into the literal.

Something like this (where doc is XmlDocument, litUserMessages is the
literal):

System.Text.Str ingBuilder sb = new System.Text.Str ingBuilder();
XmlTextWriter writer = new XmlTextWriter(n ew
System.IO.Strin gWriter(sb));
myTransform.Tra nsform(doc, null, writer);
litUserMessages .Text = sb.ToString();

--steve

Dec 15 '05 #7
The workaround for me was to get rid of the Xml web control completely.
Since we're just using it to transform an xml doc to html and then
dump the contents on a web page, I replaced the Xml web control with a
simple Literal control. Then, I just programmaticall y transform the
xml doc and put the result of the transformation (which for us is raw
html) into the literal.

Something like this (where doc is XmlDocument, litUserMessages is the
literal):

System.Text.Str ingBuilder sb = new System.Text.Str ingBuilder();
XmlTextWriter writer = new XmlTextWriter(n ew
System.IO.Strin gWriter(sb));
myTransform.Tra nsform(doc, null, writer);
litUserMessages .Text = sb.ToString();

--steve

Dec 15 '05 #8

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

Similar topics

1
3177
by: Quentin | last post by:
hey there, ok i made a class, that inherits webcontrol, and i add an htmltable to it. I was wondering how to declare an ascx file as an object in my class, like that i could change the content (the ascx file) of a cell thanks to a property and it would be great :) Merci d'avance pour l'aide :)
0
1309
by: Matze | last post by:
I have a function that has an Argument of type System.Web.UI.WebControls.WebControl. I want to set the text-property of that control. Of course it doesnt work if I cast that control to (WebControl), because WebControl doesnt have a property Text. Most Controls that inherit WebControl have text so I guess there must be an common Interface implemented, but cant figure out what it is. Goal would be something like: private function...
0
911
by: George Kustas | last post by:
I am using the Xml Web control to transform an XML string insto a readable HTML display on the page: Xml1.DocumentContent = <XML string from my database> Xml1.TransformSource = "./transform.xslt"; XslTransform xt = Xml1.Transform; It works, but the css stylesheet that I'm linking to in the xslt is ignored if I use a relative path:
0
1763
by: Harry F. Harrison | last post by:
Here's the situation...Context - Using an Inherited WebControl object as a base for server custom controls. In a web custom control, whenever I create a child control and add it to the Controls class, it takes 3 lines of code. Example: Dim TextBox as System.Web.UI.WebControls.TextBox 1..TextBox = New System.Web.UI.WebControls.TextBox
0
1598
by: Lucas, Todd | last post by:
Hello everyone! I'm having a problem with a WebControl that I'm designing for a Menu. I've been at it for about 3 weeks now, and can't seem to get around this problem. So I'm hoping that someone can help me ... My environment: VS 2003 v7.1.3088, Win2K v5.0.2195 SP3, IE6 v6.0.2800.1106 browser. I have a class (C3Menu) derived from WebControl, with a property (MenuItems) that is a collection of menu items. The collection property is...
9
2667
by: kw | last post by:
What is the proper way to get the element ID for a client script? For example, suppose in the WebControl: TextBox t=new TextBox; t.ID=this.ClientID+"X"; .... Then elsewhere we want to access it on the client: Control.Attributes = "javascript:document.getElementById('"+this.ClientID+"X"+"').value= 'test';";
0
1149
by: Alex Nitulescu | last post by:
Hi, I have the following in project "RaducuCustomControls": Imports System.ComponentModel Imports System.Web.UI <DefaultProperty("Text"), ToolboxData("<{0}:Rotator1 runat=server></{0}:Rotator1>")> Public Class Rotator1 Inherits System.Web.UI.WebControls.WebControl Public Items As New ArrayList()
0
1643
by: Mike Hofer | last post by:
Hi everyone. I could really use some help. First, the backstory: ===================== I *really* need a 3-state checkbox for my ASP.NET application. Specifically, I need one that lets me set the image for the checkbox portion so that the control conforms to my site's visual style, and that lets me set the style for the text in both the enabled and disabled states. As you might expect, I couldn't find one. So I decided to roll my own.
0
1257
by: Charlie | last post by:
When a property of a WebControl is changed at design-time in the property window, the Render method for that WebControls runs. When the property of one WebControl cascades to another WebControl, the actual property for the receiving control is changed, but the Render method for that control is not called. Manually calling Render causes an invalid property error. If I set the property in the properties window for the second control,...
0
9579
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9857
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
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
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.