mlreportgen.dom.FOProperty class

Package: mlreportgen.dom
Superclasses:

FO property for PDF output

Description

Creates an object that specifies an XML Style Sheet Language (XSL) Formatting Object (FO) property. The DOM API uses FO objects to format PDF output. Use this object with mlreportgen.FOProperties to apply FO properties not supported by DOM format objects. For more information, see w3.org/2002/08//XSLFOsummary.html.

Construction

prop = FOProperty(Name,Value) creates an FO format property having the specified name and value.

Input Arguments

expand all

FO property name, specified as a character vector.

Property value for the corresponding property name, specified as a character vector.

Output Arguments

expand all

FO format object, returned as an mlreportgen.dom.FOProperty object.

Properties

expand all

Children of this document element, specified as an array of DOM objects. This property is read-only.

ID for this document element, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

FO property name, specified as a character vector.

Parent of this document element, specified as a DOM object. This property is read-only.

Tag for this document element, specified as a character vector or string scalar.

The DOM 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. Specifying your own tag value can help you to identify where an issue occurred during document generation.

Property value for the corresponding property name, specified as a character vector.

Examples

collapse all

This example shows how to apply an FO property to a List object. Using the DOM API, you can set a page break property on a paragraph using PageBreakBefore. However, you cannot use the PageBreakBefore property on a list. Instead, for PDF output, you can use the FO property 'break-before' with the value 'page'.

import mlreportgen.dom.*

d = Document('Break Before List','pdf');

listbreak = FOProperty('break-before','page');
p = Paragraph('First Page');
p.Style = {PageBreakBefore};
append(d,p);

p = Paragraph('Second Page');
p.Style = {PageBreakBefore};
append(d,p);

list = UnorderedList({'Earl Grey','Jasmine','Honeybush'});
list.Style = {FOProperties(listbreak)};
append(d,list);

close(d);
rptview(d.OutputPath);
Introduced in R2016a