Main Content

append

Class: mlreportgen.dom.OrderedList
Namespace: mlreportgen.dom

Append content to ordered list

Description

listItemObjOut = append(orderedList,listItemObj) appends a list item to an ordered list.

listItemsOut = append(orderedList,listItems) appends matrix or a cell array of list items.

example

listObjOut = append(orderedList,list) appends an ordered or unordered list.

example

customElementOut = append(orderedList,customElementObj) appends a custom element.

Examples

expand all

Add three items to a list.

import mlreportgen.dom.*;
myReport = Document('myDoc','html');

ol = OrderedList({'Item 1' 'Item 2'});
append(myReport,ol);
append(ol,{'Item 3' 'Item 4' 'Item 5'});

close(myReport);
rptview('myDoc','html');
import mlreportgen.dom.*;
myReport = Document('myDoc','html');

ol = OrderedList({'Item 1' 'Item 2'});
append(myReport,ol);

ulist = UnorderedList({'subitem1' 'subitem2'});
append(ol,ulist);

close(myReport);
rptview('myDoc','html');
import mlreportgen.dom.*;
myReport = Document('myDoc','html');
ol = OrderedList({'a1',OrderedList({'a1','a2','b2'}),'b1'});
append(myReport,ol);
close(myReport);
rptview('myDoc','html');
import mlreportgen.dom.*;
myReport = Document('myDoc','html');

ol = OrderedList({'a1',{'a2','b2'},'b1'});
append(myReport,ol);

close(myReport);
rptview('myDoc','html');

Input Arguments

expand all

Ordered list to append content to, specified as an mlreportgen.dom.OrderedList object.

List item to append, specified as an mlreportgen.dom.ListItem object.

A matrix can include numeric or Boolean values.

Cell array containing a combination of the following:

  • A character vector

  • A number

  • A Boolean value

  • One of the following DOM objects:

    • mlreportgen.dom.Text

    • mlreportgen.dom.Paragraph

    • mlreportgen.dom.ExternalLink

    • mlreportgen.dom.InternalLink

    • mlreportgen.dom.Table

    • mlreportgen.dom.Image

    • mlreportgen.dom.CustomElement

  • Horizontal one-dimensional array (for a sublist)

To append an ordered list, use an OrderedList DOM object instead of using the listContent argument.

List to append, specified as an mlreportgen.dom.OrderedList or mlreportgen.dom.UnorderedList object.

The custom element must be a valid HTML or Word child of a list, depending on whether the output type of the document to which this element is appended is HTML or Word.

Output Arguments

expand all

List items appended to an ordered list, represented by an mlreportgen.dom.ListItem object, matrix, or cell array.

List items appended to an ordered list, represented by a matrix or cell array, depending on the format used for the listItems input argument.

List items appended to an ordered list, represented by an mlreportgen.dom.ListItem object, matrix, or cell array.

Custom element appended to ordered list, represented by an mlreportgen.dom.CustomElement object.

Version History

Introduced in R2014b