Skip to main content
Jump to: navigation, search

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

 
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 (accessed through <code>Window->Preferences->OHF H3ET->Batch Generator->XML Batch Data Source</code>). Its main use is to declare the location of the required data source. 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 <code>/</code>).
+
A preference page is available to configure the XML data source (accessed through <code>Window->Preferences->OHF H3ET->Batch Generator->XML Batch Data Source</code>). Its main use is to declare the location of the required data source. 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 tokens. The context path is evaluated as another XPath, therefore use <code>/root</code> instead of <code>/root/</code> (no final <code>/</code>).

Latest revision as of 10:25, 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 (accessed through Window->Preferences->OHF H3ET->Batch Generator->XML Batch Data Source). Its main use is to declare the location of the required data source. 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 tokens. The context path is evaluated as another XPath, therefore use /root instead of /root/ (no final /).

Back to the top