mlreportgen.dom.RawText Class
Namespace: mlreportgen.dom
Insert HTML, Microsoft Word XML, or PDF Formatting Object markup in document
Description
Use an object of the mlreportgen.dom.RawText class to insert HTML, Microsoft® Word XML markup, or PDF Formatting Object markup in a document.
To see what DOM objects you can append an mlreportgen.dom.RawText object to,
see Append mlreportgen.dom.RawText object to DOM class object.
The mlreportgen.dom.RawText class is a handle class.
Creation
Description
creates an
empty text = RawTextRawText object.
You can append a RawText object only to a
Document object.
creates a text = RawText(htmlMarkup)RawText object containing the specified HTML
markup.
Input Arguments
HTML markup, specified as a character vector or string scalar.
htmlMarkup specifies the property
HTMLText. The markup must be valid HTML markup
that can be validly inserted in the body element of the HTML output
document. If you insert invalid markup in an HTML document, the document
may not display correctly. To improve the readability of your report
document, consider assigning the markup to a variable. Then use the
variable as an input argument, as shown in the example below.
HTML markup, Word XML markup, or PDF Formatting Objects, specified as
a character vector or string scalar. If doctype is:
"html"—markupspecifies the propertyHTMLText. The markup must be valid HTML markup that can be validly inserted in the body element of the HTML output document. If you insert invalid markup in an HTML document, the document may not display correctly."docx"—markupspecifies the propertyDOCXText. The markup must be valid Word XML markup that can be validly inserted in thew:bodyelement of the Microsoft Word output document. If you insert invalid markup in a Microsoft Word document, Word may be unable to open the document."pdf"—markupspecifies the propertyPDFText. The value of this property must be valid Formatting Objects (FO) markup that can be inserted into afo:flow,fo:block, orfo:table-cellelement of the FO representation of the PDF output document. If you insert invalid FO objects in a PDF document, the document may not display correctly.
To improve the readability of your report document, consider assigning the markup to a variable. Then use the variable as an input argument, as shown in the example below.
Type of markup to use, specified as a character vector or string scalar.
Properties
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:
GetAccess | public |
SetAccess | public |
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:
GetAccess | public |
SetAccess | public |
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" or "pdfa" (since R2025a), 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:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Parent of this object, specified as a document element object. A document element must have only one parent.
Attributes:
GetAccess | public |
SetAccess | private |
NonCopyable | true |
Tag, 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. Use this value to help identify
where an issue occurs during document generation.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Object identifier, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char | string
Examples
Assign HTML markup to a variable and use that variable to create a RawText object to append to a document.
import mlreportgen.dom.*; d = Document('test','html'); script = [ ... '<script>' ... 'document.write("Hello World!")' ... '</script>' ... ]; append(d,RawText(script)); close(d); rptview('test','html');
More About
You can append an mlreportgen.dom.RawText object to
these DOM class objects:
mlreportgen.dom.HTMLPage(since R2024a)mlreportgen.dom.TemplateDocumentPart(since R2023b)
Version History
Introduced in R2014b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)