Click to See Complete Forum and Search --> : Problem with Xml & XSL, please HELP


tiraman
March 29th, 2004, 01:36 PM
Hi,

I m working in VB.NET in front of ASP.Net and I would like to

Transform Xml with XSL and I would like to get the Html results as

string into one of my string params.

How can I do that?

10x

Craig Gemmill
March 29th, 2004, 02:21 PM
Imports System.Xml
Imports System.Xml.Xsl
Module Module1

Sub Main()
Dim myXslTransform As XslTransform
myXslTransform = New XslTransform()
myXslTransform.Load("books.xsl")
myXslTransform.Transform("books.xml", "ISBNBookList.xml")
End Sub

End Module


Source:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q300929

tiraman
March 29th, 2004, 03:37 PM
first 10x for your response :-)

2nd i will try to make my self clear about my needs .

i have an sql statment <B>"select * from XXX for xml auto"</B>
that return an xml string .

i am using the <B>SqlCommand.ExecuteXmlReader()</B> method
in order to execute the query and so far every thing ok .

Than i m doing the following in order to get the xml into my
string param : (if you have another way i will be happy to know)

sMyXml = "<root>"
Do While xmlr.ReadState <> xmlr.ReadState.EndOfFile
sMyXml = sMyXml & xmlr.ReadOuterXml()
Loop
sMyXml = sMyXml & "</root>"

Now i have the xml in the sMyXml parameter .

i would like to transform this xml string with some xsl file
and the HTML result i would like to get into sHTML (string) and not into a file as your example does .

10x again :-)