473,595 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using ASP.NET to transform the XML and pass variables to XSLT

I think I've gotten the hang of XML and XSLT...at least enough to produce
the results I'm looking for.

I now need to take the next step and use ASP.NET (using VB.NET) to take the
xml and send it to the xslt along with a parameter and get xhtml returned.

The catch is that I'm not finding any samples of how to do that. I can find
(as usual) some C# examples, and a few VB.NET for client apps samples, but
nothing for ASP.NET using VB.NET.

What I am finding appears to be using ASPX to transform the file rather than
passing it off to a XSLT file (is, using the XML more as a database query).

Can anyone point me in the right direction towards an ASP.NET/VB.net
solution for this? I think this is the process I need:

- grab xml
- assign variable/parameter
- have xstl transform the xml using the parameter
- return (x)html to pass back to the browser in the usercontrol

-Darrel
Nov 12 '05 #1
4 9279
This URL has a VB example. Should get you most of the way.
http://msdn.microsoft.com/library/en...ionObjects.asp

The example writes to the transform results to file. You can replace the
writer in the example with the Response object instead.

-Naraen

---
"darrel" <no*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I think I've gotten the hang of XML and XSLT...at least enough to produce
the results I'm looking for.

I now need to take the next step and use ASP.NET (using VB.NET) to take the xml and send it to the xslt along with a parameter and get xhtml returned.

The catch is that I'm not finding any samples of how to do that. I can find (as usual) some C# examples, and a few VB.NET for client apps samples, but
nothing for ASP.NET using VB.NET.

What I am finding appears to be using ASPX to transform the file rather than passing it off to a XSLT file (is, using the XML more as a database query).
Can anyone point me in the right direction towards an ASP.NET/VB.net
solution for this? I think this is the process I need:

- grab xml
- assign variable/parameter
- have xstl transform the xml using the parameter
- return (x)html to pass back to the browser in the usercontrol

-Darrel

Nov 12 '05 #2
> This URL has a VB example. Should get you most of the way.

http://msdn.microsoft.com/library/en...ionObjects.asp

Naraen:

THANK YOU! Reading it now!

-Darrel
Nov 12 '05 #3
> The example writes to the transform results to file. You can replace the
writer in the example with the Response object instead.


Naraen (or anyone else):

Can you elaborate on the Response object? I can't find any documentation on
how to use that to return the HTML I want.

If I just do this:

xslt.Transform( doc, xslArg, response, Nothing)

I get:

Overload resolution failed because no accessible 'Transform' can be called
with these arguments

I'm guessing the RESPONSE method isn't a part of xmltextwriter?

-Darrel
Nov 12 '05 #4
> If I just do this:

xslt.Transform( doc, xslArg, response, Nothing)

I get:

Overload resolution failed because no accessible 'Transform' can be called
with these arguments


Oops. Think I got it:

xslt.Transform( doc, xslArg, Response.Output , Nothing)

Thanks, Naraen!

-Darrel
Nov 12 '05 #5

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

Similar topics

2
4388
by: Neal | last post by:
I need to know how to pass a parameter from PERL to an XSLT when using that XSLT to transform XML. For instance, I'd like to pass a paramter that I retrieve from the queryString and pass it into XSLT which will create my HTML. Here's what I have for the basic transformation: #!/usr/local/bin/perl use XML::XSLT;/
3
17700
by: Christopher Ambler | last post by:
This has to be a FAQ, but I can't seem to find the answer anywhere! I have an application that consumes a web service that returns me a string full of XML. I also have an XSLT for outputting the XML. I need to take that string, apply the XSLT to it, and get the output into a string suitable for writing out to a tcp port. Essentially, an XML string, transformed into another string.
6
2153
by: Mark Miller | last post by:
I have a scheduled job that uses different XSL templates to transform XML and save it to disk. I am having problems with the code below. The problem shows up on both my development machine (Windows XP Pro SP 1, .Net Framework 1.1) and on our production server (Windows 2K SP 4, .Net Framework 1.1). I have simplified the code and data to isolate the problem. When I use the xsl:strip-space (Line 12) declaration in conjunction with the xsl:sort...
0
3395
by: canasdaq | last post by:
Can anyone please help me. I was looking at the article "http://www.eggheadcafe.com/articles/20030603.asp". I am new to .net and know nothing in c#. I want to write a menu in asp.net. Can anyone please help me in converting this c# code to vb.net. I tried, but it is not giving the output. Here is the c# code using System using System.Collections using System.ComponentModel using System.Data using System.Drawing using System.Web using...
6
4971
by: Lenny Wintfeld | last post by:
Hi I'm attempting additions/changes to a Java program that (among other things) uses XSLT to transform a large (96 Mb) XML file. It runs fine on small XML files but generates OutOfMemory exceptions with large XML files. I tried a simple punt of -Xmx512MB but that didn't work. In the future, the input XML file may become considerably bigger than 96 MB, so even if it did work, it probably would be putting off the inevitable to some later...
3
5077
by: Rob | last post by:
All I want to do is execute a simple transformation in VB.net.... I know this has to be simple. I tried the following as suggested by a web page I found.... Dim xslt as New XslTransform() xslt.Load("Filename") xslt.Transform("InFile", "ResultFile")
3
10980
by: J055 | last post by:
Hi I'd like to get a populated datatable, create an in memory xml document (file shouldn't be more than a couple of meg), load an XSLT file, do a transform and stream it to a browser. What am I Missing please? MemoryStream strm = new MemoryStream(); XmlWriter writer = XmlWriter.Create(strm);
2
8904
by: Ch Pravin | last post by:
Hi All: I am having the following xml which i need to convert to excel using xslt. Please help me out. Afghanistan.xml <?xml version="1.0" encoding="utf-16"?> <Languages BuildVersion="1,5,0815,0 " CountryName="Afghanistan" > <Language locale="English">
9
2494
by: WT | last post by:
Hello, I have code created with .net 1.0 and migrated to 3.5. Form 2.0 the XslTransform class is obsolete and the vs2008 compiler generates warnings that these classes are absolete suggesting to use XslCompiledTransform. But all this was rendered using an Xml control and I can't find a way to relate this control to an XslCompiledTransform ? Any help appreciated to solve this migration pb.
0
7955
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
7883
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
8261
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8019
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5839
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5418
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
3911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2391
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
0
1223
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.