How do I access a XML data bank from a script

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in SOAtest
Can you give me some sample code for accessing a previously populated XML data bank in a script. Thanks.
Tagged:

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    See the following SOAtest FAQ thread the script in the post is what you want. Instead of using "Untitled" you'll want to use "Generated Data Source". That is the name of all XML Data Bank data sources. The second parameter input should be the name of the XML Data Bank data source column.
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    That sample code shows how to use one datasource. What if we need to access a generated table: "myTable" and an xml data bank: "Generated Data Source" in the script. How does the addDataSources method needs to be changed? Can you show me some sample code. Thanks.
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Whenever you access from multiple data sources, the iteration over the values is NOT 1-to-1. Instead, it will iterate over the data sources in a combination fashion. For example, assume you have the following data sources:

    DS1:
    1
    2
    3

    DS2:
    4
    5
    6


    During the first iteration it will grab values [1, 4] from DS1 and DS2 respectively. Second iteration it will grab values [1, 5], third iteration it will grab values [1, 6]. Next it will move the cursor by one for DS1 so it points to second row now, thus it grabs values [2, 4] from DS1 and DS2 respectively.

    You can always access Generated Data Source without returning that name from addDataSources(context) method. But if you want to access multiple standard data sources please refer to the following Scripting thread which shows you how addDataSources(context) should be modified to return a collection of data source names.
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Thanks, this works.
Sign In or Register to comment.