XmlDataLoadOptions class
Leave feedback
On this page
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:
| Constructor | Description |
|---|---|
| init | Initializes a new instance of this class with default options. |
| 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. |
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")
)
Task guides that use XmlDataLoadOptions:
- module
groupdocs.assembly.data
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.