473,386 Members | 1,753 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,386 software developers and data experts.

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 9269
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*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.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
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...
3
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...
6
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...
0
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...
6
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...
3
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() ...
3
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...
2
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...
9
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
0
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,...
0
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...

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.