469,352 Members | 1,661 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

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 9110
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Neal | last post: by
reply views Thread by canasdaq | last post: by
3 posts views Thread by Rob | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.