Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / November 2005

Tip: Looking for answers? Try searching our database.

getting TEXT of an xslt.transform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
darrel - 03 Nov 2005 00:01 GMT
On my page right now, I call a function:

<%=getMenu()%>

in my codebehind, I have the function do an xslt transformation:

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

Instead of calling the function directly on the main page, I now want to
just place a literal on the page and set the literal's text via codebehind.
However, I can't seem to do this:

ltl_menu.Text = xslt.Transform(doc, xslArg, Response.Output, Nothing)

As the 'expression does not return a value'.

How can one get the result of the text as a string?

-Darrel
Pascal Schmitt - 03 Nov 2005 01:07 GMT
Hello!

> ltl_menu.Text = xslt.Transform(doc, xslArg, Response.Output, Nothing)
>
> As the 'expression does not return a value'.
>
> How can one get the result of the text as a string?

Don't write it to Response.Output but use StringWriter: (untested)

StringWriter sw = new StringWriter();
xslt.Transform( doc, xslArg, sw, null );
ltk_menu.Text = sw.ToString();

There is also an XSLT-WebControl...

Signature

Pascal Schmitt

darrel - 03 Nov 2005 01:54 GMT
> Don't write it to Response.Output but use StringWriter: (untested)
>
[quoted text clipped - 3 lines]
>
> There is also an XSLT-WebControl...

aha! perfect! Thanks!

-Darrel

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.