public interface IMailMergeDataSourceRoot
Example:
package XMLMailMerge;
import com.aspose.words.IMailMergeDataSource;
import com.aspose.words.IMailMergeDataSourceRoot;
/**
* Use this class when using mail merge with regions and nested mail merge with numerous regions. All regions in the document
* are called here and data from XML.
*/
public class XmlMailMergeDataSet implements IMailMergeDataSourceRoot
{
/**
* Creates a new XmlMailMergeDataSet for the specified XML document. All regions in the document can be
* merged at once using this class.
*
* @param xmlDoc The DOM object which contains the parsed XML data.
*/
public XmlMailMergeDataSet(org.w3c.dom.Document xmlDoc)
{
mXmlDoc = xmlDoc;
}
public IMailMergeDataSource getDataSource(String tableName) throws Exception
{
return new XmlMailMergeDataTable(mXmlDoc, tableName);
}
private org.w3c.dom.Document mXmlDoc;
}
| Method Summary | ||
|---|---|---|
abstract IMailMergeDataSource | getDataSource(java.lang.String tableName) | |
| The Aspose.Words mail merge engine invokes this method when it encounters a beginning of a top-level mail merge region. | ||
| Method Detail |
|---|
getDataSource | |
public abstract IMailMergeDataSource getDataSource(java.lang.String tableName) throws java.lang.Exception | |
When the Aspose.Words mail merge engines populates a document with data and encounters MERGEFIELD TableStart:TableName,
it invokes
If a data source (table) with the specified name does not exist, your implementation should return null.
tableName - The name of the mail merge region as specified in the template document. Case-insensitive.