XmlDataSource class

XmlDataSource class

Provides access to data of an XML file or stream to be used within a report. To learn more, visit the LINQ Reporting Engine documentation article.

Remarks

To access data of the corresponding file or stream while generating a report, pass an instance of this class as a data source to one of ReportingEngine.BuildReport overloads.

When XML Schema Definition is passed to a constructor of this class, data types of values of simple XML elements and attributes are determined according to the schema. So in template documents, you can work with typed values rather than just strings.

When XML Schema Definition is not passed to a constructor of this class, data types of values of simple XML elements and attributes are determined automatically upon their string representations. So in template documents, you can work with typed values in this case as well. The engine is capable to automatically recognize values of the following types:

  • int

  • bool

  • datetime.datetime

  • string

Note that for automatic recognition of data types to work, string representations of values of simple XML elements and attributes should be formed using invariant culture settings.

To override default behavior of XML data loading, initialize and pass a XmlDataLoadOptions instance to a constructor of this class.

Constructors

NameDescription
XmlDataSource(xml_path)Creates a new data source with data from an XML file using default options for XML data loading.
XmlDataSource(xml_stream)Creates a new data source with data from an XML stream using default options for XML data loading.
XmlDataSource(xml_path, xml_schema_path)Creates a new data source with data from an XML file using an XML Schema Definition file. Default options are used for XML data loading.
XmlDataSource(xml_stream, xml_schema_stream)Creates a new data source with data from an XML stream using an XML Schema Definition stream. Default options are used for XML data loading.
XmlDataSource(xml_path, options)Creates a new data source with data from an XML file using the specified options for XML data loading.
XmlDataSource(xml_stream, options)Creates a new data source with data from an XML stream using the specified options for XML data loading.
XmlDataSource(xml_path, xml_schema_path, options)Creates a new data source with data from an XML file using an XML Schema Definition file. The specified options are used for XML data loading.
XmlDataSource(xml_stream, xml_schema_stream, options)Creates a new data source with data from an XML stream using an XML Schema Definition stream. The specified options are used for XML data loading.

See Also