XmlDataSource

Inheritance: java.lang.Object

public class XmlDataSource

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.

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.

In template documents, if a top-level XML element contains only a list of elements of the same type, an XmlDataSource instance should be treated in the same way as if it was a DataTable instance. Otherwise, an XmlDataSource instance should be treated in the same way as if it was a DataRow instance. For more information, see template syntax reference(https://docs.aspose.com/display/wordsjava/Template+Syntax).

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:

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

Constructor Description
XmlDataSource(String xmlPath) Creates a new data source with data from an XML file using default options for XML data loading.
XmlDataSource(InputStream xmlStream) Initializes a new instance of this class.
XmlDataSource(String xmlPath, String xmlSchemaPath) Creates a new data source with data from an XML file using an XML Schema Definition file.
XmlDataSource(InputStream xmlStream, InputStream xmlSchemaStream) Initializes a new instance of this class.
XmlDataSource(String xmlPath, XmlDataLoadOptions options) Creates a new data source with data from an XML file using the specified options for XML data loading.
XmlDataSource(InputStream xmlStream, XmlDataLoadOptions options) Initializes a new instance of this class.
XmlDataSource(String xmlPath, String xmlSchemaPath, XmlDataLoadOptions options) Creates a new data source with data from an XML file using an XML Schema Definition file.
XmlDataSource(InputStream xmlStream, InputStream xmlSchemaStream, XmlDataLoadOptions options) Initializes a new instance of this class.

Methods

Method Description
equals(Object arg0)
getClass()
hashCode()
notify()
notifyAll()
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

XmlDataSource(String xmlPath)

public XmlDataSource(String xmlPath)

Creates a new data source with data from an XML file using default options for XML data loading.

Parameters:

Parameter Type Description
xmlPath java.lang.String The path to the XML file to be used as the data source.

XmlDataSource(InputStream xmlStream)

public XmlDataSource(InputStream xmlStream)

Initializes a new instance of this class.

Parameters:

Parameter Type Description
xmlStream java.io.InputStream

XmlDataSource(String xmlPath, String xmlSchemaPath)

public XmlDataSource(String xmlPath, String xmlSchemaPath)

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.

Parameters:

Parameter Type Description
xmlPath java.lang.String The path to the XML file to be used as the data source.
xmlSchemaPath java.lang.String The path to the XML Schema Definition file that provides schema for the XML file.

XmlDataSource(InputStream xmlStream, InputStream xmlSchemaStream)

public XmlDataSource(InputStream xmlStream, InputStream xmlSchemaStream)

Initializes a new instance of this class.

Parameters:

Parameter Type Description
xmlStream java.io.InputStream
xmlSchemaStream java.io.InputStream

XmlDataSource(String xmlPath, XmlDataLoadOptions options)

public XmlDataSource(String xmlPath, XmlDataLoadOptions options)

Creates a new data source with data from an XML file using the specified options for XML data loading.

Parameters:

Parameter Type Description
xmlPath java.lang.String The path to the XML file to be used as the data source.
options XmlDataLoadOptions Options for XML data loading.

XmlDataSource(InputStream xmlStream, XmlDataLoadOptions options)

public XmlDataSource(InputStream xmlStream, XmlDataLoadOptions options)

Initializes a new instance of this class.

Parameters:

Parameter Type Description
xmlStream java.io.InputStream
options XmlDataLoadOptions

XmlDataSource(String xmlPath, String xmlSchemaPath, XmlDataLoadOptions options)

public XmlDataSource(String xmlPath, String xmlSchemaPath, XmlDataLoadOptions 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.

Parameters:

Parameter Type Description
xmlPath java.lang.String The path to the XML file to be used as the data source.
xmlSchemaPath java.lang.String The path to the XML Schema Definition file that provides schema for the XML file.
options XmlDataLoadOptions Options for XML data loading.

XmlDataSource(InputStream xmlStream, InputStream xmlSchemaStream, XmlDataLoadOptions options)

public XmlDataSource(InputStream xmlStream, InputStream xmlSchemaStream, XmlDataLoadOptions options)

Initializes a new instance of this class.

Parameters:

Parameter Type Description
xmlStream java.io.InputStream
xmlSchemaStream java.io.InputStream
options XmlDataLoadOptions

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

Parameter Type Description
arg0 java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int