Selbstschließende Tags erkennen

Contents
[ ]

HTML kann eine Vielzahl von Tag-Formatierungen für leere Tags wie <td></td> oder <td/>. Aspose.Cells unterstützt beide Formate. Diese Funktion kann getestet werden, indem die beigefügte Beispieldatei HTML in eine Excel-Datei konvertiert wird. Die Beispieldatei HTML und die Ausgabedateien können zum Testen über die folgenden Links heruntergeladen werden.

Quelldatei

Ausgabedatei

source_directory = "Examples/SampleFiles/SourceDirectory/"
output_directory = "Examples/SampleFiles/OutputDirectory/"
loadOptions = HtmlLoadOptions(LoadFormat.HTML)
# Load the Sample Workbook
workbook = Workbook(source_directory + "sampleSelfClosingTags.html", loadOptions)
# Save the excel file.
workbook.save(output_directory + "sampleSelfClosingTags_out.xlsx")