XML transformation: how to save it into a hmtl file.

vb6 , xml Tumkūr, India
  • 10 years ago
    I want to transform an "test.xml" file using a "test.xsl" file and be able to save the HTML output into "test.html".

    Browser side transformation is working fine as the test.xml when made to refer the test.xsl it displays the html content in the bowser as expected.
    But wen i try to get the transformed in VB code, im getting the transformed output (test.html) to be same as the contents of test.xsl.

    My code:
    Dim objXML, objXSL, objHTML As DOMDocument
    Set objXML = New DOMDocument
    Set objXSL = New DOMDocument
    Set objHTML = New DOMDocument
    objXML.async = False
    objXSL.async = False
    objHTML.async = False
    objHTML.validateOnParse = True

    Dim myErr

    objXML.Load App.Path & "\test.xml"
    If (objXML.parseError.errorCode <> 0) Then
    Set myErr = objXML.parseError
    MsgBox myErr.reason
    objXSL.Load App.Path & "\test.xsl"
    If (objXSL.parseError.errorCode <> 0) Then
    Set myErr = objXSL.parseError
    MsgBox myErr.reason
    objXML.transformNodeToObject objXSL, objHTML
    objHTML.save App.Path & "\test.html"
    WebBrowser1.Navigate App.Path & "\test.xml"
    End If
    End If

    please help.
  • 10 years ago
    pls help.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - Rick Osborne