Sample code for 30+ languages & platforms
VBScript

Convert HTML File to XML File

See more HTML-to-XML/Text Examples

Convert HTML file to XML file.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

success = 0

' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set htmlToXml = CreateObject("Chilkat.HtmlToXml")

' Indicate the charset of the output XML we'll want.
htmlToXml.XmlCharset = "utf-8"

success = htmlToXml.ConvertFile("test.html","out.xml")
If (success <> 1) Then
    outFile.WriteLine(htmlToXml.LastErrorText)
Else
    outFile.WriteLine("Success")
End If


outFile.Close