Groups | Blog | Home
all groups > dotnet xml > april 2004 >

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



darrel
4/5/2004 11:05:51 AM
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

NaraendiraKumar R. R.
4/5/2004 11:44:43 PM
This URL has a VB example. Should get you most of the way.
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconXsltArgumentListForStylesheetParametersExtensionObjects.asp

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

-Naraen

---
[quoted text, click to view]

darrel
4/6/2004 9:24:18 AM
[quoted text, click to view]
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconXsltArgumentListForStylesheetParametersExtensionObjects.asp

Naraen:

THANK YOU! Reading it now!

-Darrel

darrel
4/6/2004 4:31:29 PM
[quoted text, click to view]

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

darrel
4/6/2004 5:36:52 PM
[quoted text, click to view]

Oops. Think I got it:

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

Thanks, Naraen!

-Darrel

AddThis Social Bookmark Button