Sample code for 30+ languages & platforms
PowerShell

Convert HTML File to XML File

See more HTML-to-XML/Text Examples

Convert HTML file to XML file.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

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

$htmlToXml = New-Object 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 -ne $true) {
    $($htmlToXml.LastErrorText)
}
else {
    $("Success")
}