473,769 Members | 4,584 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 9289
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
4394
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
17708
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
2169
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
3407
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
4995
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
5084
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
10992
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
8917
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
2504
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
10211
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...
0
10045
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
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
8870
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
6672
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
5298
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.