Convert HTML to XML in C++

Import HTML content into presentation slides and save the result in PowerPoint XML Presentation format.

Convert HTML to XML in C++

Aspose.Slides for C++ can import HTML content into presentation slides and save the resulting presentation in PowerPoint XML Presentation format.

The generated XML represents a presentation rather than a generic transformation of the source HTML markup. Aspose.Slides can also export the imported content to PowerPoint, PDF, images, and other supported formats.

Convert HTML to XML Using C++

To convert HTML content to PowerPoint XML, create a Presentation, remove its default slide, import the HTML with AddFromHtml, and call Save with SaveFormat::Xml.

C++ code for converting HTML into XML

auto presentation = MakeObject<Presentation>();

presentation->get_Slides()->RemoveAt(0);
auto htmlStream = File::OpenRead(u"page.html");
presentation->get_Slides()->AddFromHtml(htmlStream);
htmlStream->Dispose();

presentation->Save(u"output.xml", SaveFormat::Xml);
presentation->Dispose();

How to Convert HTML to XML Using Aspose.Slides for C++ API

These are the steps to convert HTML to XML in C++.

  1. Install Aspose.Slides for C++ .

  2. Add a library reference (import the library) to your C++ project.

  3. Open the source HTML file in C++.

  4. Call Save with the output file path and SaveFormat::Xml.

Free Online Converter

Convert presentations and slides online.

Convert HTML to Other Supported Formats

You can also convert HTML and save it to other file formats. See all supported formats below.