clone

Class: mlreportgen.dom.HTML
Namespace: mlreportgen.dom

Copy HTML object

Syntax

clonedHTMLObj = clone(sourceHTMLObj)

Description

clonedHTMLObj = clone(sourceHTMLObj) copies (clones) the specified HTML object, including its children.

Input Arguments

expand all

HTML object to copy, specified as an mlreportgen.dom.HTML object.

Output Arguments

expand all

HTML object with appended content, returned as an mlreportgen.dom.HTML object.

Examples

expand all

Create an HTML object from HTML text, to use for a Microsoft® Word report.

import mlreportgen.dom.*;
rpt = Document('ClonedHTMLReport','docx');     
htmlObj1 = HTML('<p><b>Hello</b> <i style="color:green">World</i></p>');

Append the HTML object to the report.

append(rpt,htmlObj1);

Copy the HTML object and append the copy to the report.

htmlObj2 = clone(htmlObj1);
append(rpt,htmlObj2);

Generate the report.

close(rpt);
rptview(rpt.OutputPath);

Version History

Introduced in R2015a