Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

clone

Class: mlreportgen.dom.HTML
Package: 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);

Introduced in R2015a

Was this topic helpful?