XmlDataLoadOptions class

XmlDataLoadOptions class

Represents options for XML data loading.

An instance of this class can be passed into constructors of XmlDataSource.

The XmlDataLoadOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of this class with default options.

Properties

Property Description
always_generate_root_object The flag indicating whether a generated data source will always contain an object for an XML root element; if the root has no attributes and all child elements share the same name, the object is omitted by default.

Example

from groupdocs.assembly import DataSourceInfo, DocumentAssembler
from groupdocs.assembly.data import XmlDataLoadOptions, XmlDataSource

options = XmlDataLoadOptions()
options.always_generate_root_object = True  # Always create root object

xml_data_source = XmlDataSource("staff-roster.xml", options)

assembler = DocumentAssembler()
assembler.assemble_document(
    "staff-roster-root.docx",
    "staff-roster-root-report.docx",
    DataSourceInfo(xml_data_source, "data")
)

Guides

Task guides that use XmlDataLoadOptions:

See Also