xsltransform.transform() method not works in 2003

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sudhaMurugesan
    New Member
    • May 2007
    • 94

    xsltransform.transform() method not works in 2003

    Hi all,

    I am using VS2003. I am new to VS2003. I cannot transform an xml file into a string output in my windows application. But the same function works well with VS2005. it also asks for xmlresolver in the transform() function. I provided Nothing as 4th parameter, eventhough it doesnt work. anybody can help me?. I dont know where i am wrong. I need to create html files with this xml data.

    [CODE="VB"]
    Public Shared Function CreateHtmlFile( ByVal ds As DataSet, ByVal xslpath As String) As String

    Dim document As XmlDocument ' Xml document root
    Dim navigator As XPathNavigator ' navigate document
    Dim transformer As XslTransform ' transform document
    Dim output As StringWriter

    document = New XmlDocument()
    document.LoadXm l(ds.GetXml())

    ' create navigator
    navigator = document.Create Navigator

    ' load style sheet
    transformer = New XslTransform()
    transformer.Loa d(xslpath)



    ' transform XML data
    output = New StringWriter()
    transformer.Tra nsform(navigato r, Nothing, output)

    ' display transformation in text box
    Console.WriteLi ne(output.ToStr ing)

    ' write transformation result to disk
    Dim stream As FileStream = _
    New FileStream("c:\ Billcustomer1.h tml", FileMode.Create )

    Dim writer As StreamWriter = New StreamWriter(st ream)
    writer.Write(ou tput.ToString)

    ' close streams
    writer.Close()
    output.Close()
    Return output.ToString ()
    End Function
    [/code]

    With thanks,
    Sudha
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Does the function return any error message you can post? And why don't you just use VB.NET 2005 instead of VB.NET 2003 if it works in 2005?

    Steven

    Comment

    Working...