XML_Importer function
Description
Imports XML data into an OpenInsight table, optionally using an XML template.
Syntax
retval = XML_Importer(parent, XML_File, Batch_Flag, Schema_Name, Key_Tag, Target_Tags, Dict_Mappings, OI_Data_File, Create_Flag, Template_Name, Storage_Opts)
Parameters
The Inet_OI_XML function has the following parameters:
Parameters | Description |
---|---|
Parent | The parent window of the calling process. |
XML_File | The fully qualified name (e.g., C:\XMLFILES\CUSTOMERS.XML) of the operating system file containing the XML data to be imported. |
Batch_Flag | A boolean value indicating whether or not the program is being run in batch mode. In batch mode, the program will not display informational messages. Pass a 1 to indicate batch mode. Pass 0 or null for interactive mode. |
Schema_Name | The name of the schema file associated with the XML file. |
Key_Tag | The tag in the XML file that will be used as a key in the OpenInsight file. |
Target_Tags | A value-mark delimited list of tags that will be extracted and placed into the OpenInsight file. The values in Target_Tags have a one-to-one correspondence with the values in the Dict_Mappings parameter. |
Dict_Mappings | A value-mark delimited list of dictionary fieldnames into which the target tags will be mapped. Based upon Storage_Opts this parameter may be null. The values in Dict_Mappings have a one-to-one correspondence with the values in the Target_Tags parameter. |
OI_Data_File | The name of the OpenInsight file into which the XML data will be placed. |
Create_Flag | A boolean flag indicating whether or not the OI_Data_File should be created. Note: This functionality will not work in runtime versions of OpenInsight. |
Template_Name | The name of an import template that has been saved. To run imports programmatically, provide this parameter. Otherwise pass a null. Note: If Template_Name is passed as null, the user is prompted for null parameters at runtime. If Template_Name is not null, any null parameters are assumed to be null. |
Storage_Opts | Indicates how data will be stored in fields in the OpenInsight table. One of three possible values is allowed: Value - Meaning C - Create new 'F' type fields Note: This is not a valid option in Runtime versions of OpenInsight. E - Map to existing 'F' type fields. D - Create a new 'F' type field embedded with raw XML. Also create new symbolic fields to extract the XML data. Note: This is not a valid option in Runtime versions of OpenInsight. |
Returns
Returns a null, whether or not any errors were encountered.
See Also
Examples
* Import XML data into OI table using NJ_CUSTOMERS XML Import template
retval = xml_importer('','','' ,'' ,'','' ,'' ,'' ,'' , 'NJ_CUSTOMERS')
* Prompt for import parameters
retval = xml_importer()
* Import XML data using NJ_CUSTOMERS template, overriding Create_Flag
retval = xml_importer('','','' ,'' ,'','' ,'' ,'' , 'Y', 'NJ_CUSTOMERS')