Community discussion forum

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

  • 2 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
    Else
    objXSL.Load App.Path & "\test.xsl"
    If (objXSL.parseError.errorCode <> 0) Then
    Set myErr = objXSL.parseError
    MsgBox myErr.reason
    Else
    objXML.transformNodeToObject objXSL, objHTML
    objHTML.save App.Path & "\test.html"
    WebBrowser1.Navigate App.Path & "\test.xml"
    End If
    End If
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


    please help.
  • 2 years ago
    pls help.

Post a reply

Enter your message below

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

Want to stay in touch with what's going on? Follow us on twitter!