Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Details on the XML data source"

(New page: The batch generator comes enabled for use with an XML data source. Any XML file can serve as a data source. Token names are XPath queries that identify nodes in the XML file. If a given XP...)
 
Line 1: Line 1:
 
The batch generator comes enabled for use with an XML data source. Any XML file can serve as a data source. Token names are XPath queries that identify nodes in the XML file. If a given XPath identifies more than one node in an XML file, all the nodes will be used for data, with the first node populating the first file in the batch, and subsequent nodes populating subsequent files. If two (or more) XPath queries supply node sets of different size, then an empty string will be inserted when the data from the smaller XPath node set has been exhausted. See the [[Creating_a_message_batch%2C_using_an_XML_data_source_as_example|basic tutorial]] for an example of these aspects of using the XML data source.
 
The batch generator comes enabled for use with an XML data source. Any XML file can serve as a data source. Token names are XPath queries that identify nodes in the XML file. If a given XPath identifies more than one node in an XML file, all the nodes will be used for data, with the first node populating the first file in the batch, and subsequent nodes populating subsequent files. If two (or more) XPath queries supply node sets of different size, then an empty string will be inserted when the data from the smaller XPath node set has been exhausted. See the [[Creating_a_message_batch%2C_using_an_XML_data_source_as_example|basic tutorial]] for an example of these aspects of using the XML data source.
 +
 +
A preference page is available to configure the XML data source. It allows the user to set the location of the data source (required). Additionally, it allows the user to specify a context XPath. This functions as a common base path for all the tokens. For example, if we are using the XPath queries <code>/root/element1</code> and <code>/root/element2</code>, we could specify <code>/root</code> as the context path, and use <code>element1</code> and <code>element2</code> as our queries. The context path is evaluated as another XPath, therefore use <code>/root</code> instead of <code>/root/</code> (no final '/').

Revision as of 10:21, 15 August 2007

The batch generator comes enabled for use with an XML data source. Any XML file can serve as a data source. Token names are XPath queries that identify nodes in the XML file. If a given XPath identifies more than one node in an XML file, all the nodes will be used for data, with the first node populating the first file in the batch, and subsequent nodes populating subsequent files. If two (or more) XPath queries supply node sets of different size, then an empty string will be inserted when the data from the smaller XPath node set has been exhausted. See the basic tutorial for an example of these aspects of using the XML data source.

A preference page is available to configure the XML data source. It allows the user to set the location of the data source (required). Additionally, it allows the user to specify a context XPath. This functions as a common base path for all the tokens. For example, if we are using the XPath queries /root/element1 and /root/element2, we could specify /root as the context path, and use element1 and element2 as our queries. The context path is evaluated as another XPath, therefore use /root instead of /root/ (no final '/').

Back to the top