ChangeDataSource Tag

ClosedDescription

Enables users to change to a named data source.

ClosedSyntax

<ChangeDataSource ObjectName=Value Index=Value>...</ChangeDataSource>

The supported attributes include the following.

Attribute

Required/Optional

Description

ObjectName

Required

The name of the object to be changed.

Index

Required

0-based number of the data source index. Since some objects have multiple datasources, this makes sure the user grabs the intended object. This information is included in the <GetFormatProperties> and <IncludeObjectDataSources> tags.

ClosedChild Elements

The following child element tags are supported.

Tag

Required/Optional

Description

UseNamedDataSource

Required

Points to the name of the Named datasource and is used to switch the datasource.

ClosedParent Tags

<FormatSetup>

ClosedRemarks

<ChangeDataSource> is an optional tag that is used with the <FormatSetup> command.

ClosedExample

This example demonstrates the <ChangeDataSource> tag changing the data sources for two different text objects.

<?xml version="1.0" encoding="utf-8"?>

<XMLScript Version="2.0" Trusted="true">

<Command>

<FormatSetup>

<Format SaveAtEndOfJob="true">full path\Document1.btw</Format>

<ChangeDataSource ObjectName="Text 2" Index="0">

<UseNamedDataSource>DS2</UseNamedDataSource>

</ChangeDataSource>

<ChangeDataSource ObjectName="Text 1" Index="0">

<UseNamedDataSource>DS3</UseNamedDataSource>

</ChangeDataSource>

</FormatSetup>

</Command>

</XMLScript>

ClosedRequirements

BTXML Script version 1.0 (BarTender 8.0 and later versions)