Main Content

mlreportgen.dom.TemplateText Class

Namespace: mlreportgen.dom

Markup text from a document template

Description

A mlreportgen.dom.TemplateText object contains XML markup read from a document's template on opening. The object contains one of these segments of template text occurring between:

  • the beginning of the template and the first hole in the template

  • subsequent holes in the template

  • the last hole and the end of the template

Moving from hole to hole causes these segments of text to be embedded in TemplateText objects and appended to the document's list of children. This guarantees that the template text will be included in the output document in the same order in which it occurs in the template interspersed with the content appended at each hole.

The mlreportgen.dom.TemplateText class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Properties

expand all

Word XML markup text to output to a Word document, specified as a character vector or string scalar. If the document is of type "docx", it includes the value of this property. The markup must be valid Word XML markup that can be inserted into the w:body, w:p, or w:tc element of a Word document.

Attributes:

NonCopyable
true

Data Types: char | string

HTML markup text to output to an HTML document, specified as a character vector or string scalar. If the document is of type "html", "html-file", or "html-multipage", it includes the value of this property. The text must be valid HTML markup that can be inserted into a body, p, or td element of an HTML document.

Attributes:

NonCopyable
true

Data Types: char | string

Formatting Objects markup to output to a PDF document, specified as a character vector or string scalar. If the document is of type "pdf", it includes the value of this property. The value of this property must be valid Formatting Objects (FO) markup that can be inserted into a fo:flow, fo:block, or fo:table-cell element of the FO representation of PDF document content. For more information on FO, see https://www.w3.org/TR/xsl11/.

Attributes:

NonCopyable
true

Data Types: char | string

Parent of mlreportgen.dom.TemplateText object, specified as a document element object. A document element must have only one parent.

Attributes:

SetAccess
private
NonCopyable
true

Tag for the mlreportgen.dom.TemplateText object, specified as a character vector or string scalar. The DOM API generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

Object identifier for the mlreportgen.dom.TemplateText object, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

Examples

collapse all

import mlreportgen.dom.*;
d = Document('test');
d.TitleBarText = 'My Report';
open(d);
% Display browser title bar text that the DOM template parser inserts into
% the markup read from the beginning of the template.
disp(d.Children(2).HTMLText);
My Report
close(d);
rptview(d);

Version History

Introduced in R2014b