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 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();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.
How to Convert HTML to XML Using Aspose.Slides for C++ API
These are the steps to convert HTML to XML in C++.
- Install Aspose.Slides for C++.
- Add a library reference (import the library) to your C++ project.
- Open the source HTML file in C++.
- Call
Savewith the output file path andSaveFormat::Xml.
Built with Aspose.Slides
Convert HTML to XML Online
The free Aspose.Slides Conversion app is built with Aspose.Slides for C++, the same API as the code above. Open it and see what the API can do with your own HTML files.
- Runs in your browser, nothing to install.
- See how Aspose.Slides converts files before you write code.
- Upload HTML files and save them as XML.
- Download the result or convert more files.
Convert HTML to Other Supported Formats
You can also convert HTML and save it to other file formats. See all supported formats below.