Inet_OI_XML function

Exports XML data from an OpenInsight table. This function can be called directly, either from an OpenInsight program, or from the Web. If called directly, set the first parameter (Request) to null and fill in the other parameters.

retval = Inet_OI_XML(Request, Cmd, DosFile, Select_Statement, Schema_file, Template_Name, bHideMessages)

The Inet_OI_XML function has the following parameters:

ParametersDescription
RequestHTTP-request. Use only if calling from the OECGI gateway. If calling from an OpenInsight directly, set to null.

FileName = The name of the OpenInsight table that contains the data to export.
Cmda valid R/LIST LIST statement, listing the table and fields that should be exported.
DosFileThe full path name of the DOS filename to be used. Omit the extension. Inet_OI_XML creates both the .XML and .XSD files. Required.

For example, if you enter:
DosFile = C:\xmlfiles\customers
then Inet_OI_XML creates two files. The XML file will be named C:\xmlfiles\customers.xml, and the XML schema file will be named C:\xmlfiles\customers_schema.xsd.
Select_Statementa valid SELECT statement, used to make a subset of the data to export. Optional, needed only if you wish to filter the data.
Schema_FileName of Schema File. If null, the function will create the schema, if valued will use the schema specified to build the XML file.
Template_NameThe name of a saved XML Publisher template that has been previously saved. By providing this parameter, you can run XML exports programmatically. If you are not using a template, set to null.
bHideMessagesA boolean value that when true will not display processing messages.

a URL indicating the location of the file. If called from an OpenInsight program, the URL is of the form:

http:://localhost/oixml/DosFile

The Inet_OI_XML function creates the XML data file (appending the .XML extension) and the schema file (appending the .XSD extension) corresponding to the OpenInsight file.

(from BASIC+, non-Web)

*  export fields from CUSTOMERS table

request ='' 

cmd = 'LIST CUSTOMERS COMPANY FNAME LNAME CITY STATE ZIP COUNTRY'

dosfile = 'C:\XMLFILES\CUSTOMERS'

select_statement ='' 

template_name ='' 

schema_file ='' 

hide_messages = 0

 

retval = inet_oi_xml( request, cmd, dosfile, select_statement, schema_File, template_name, hide_messages)
 

*  restrict export to New Jersey customers

request ='' 

cmd = 'LIST CUSTOMERS COMPANY FNAME LNAME CITY STATE ZIP COUNTRY'

dosfile = 'C:\XMLFILES\NJ_CUSTOMERS'

select_statement = 'SELECT CUSTOMERS WITH STATE = "NJ"'

template_name ='' 

retval = inet_oi_xml( request, cmd, dosfile, select_statement, template_name)
 

*  export based on parameters stored in PRODUCTS XML Publisher template

request ='' 

cmd ='' 

dosfile =''

select_statement ='' 

template_name = 'PRODUCTS'

schema_File =''

hide_messages = 0

retval = inet_oi_xml( request, cmd, dosfile, select_statement, schema_file, template_name, hide_messages)

(Web-based)

/* to export all fields from the CUSTOMERS table, submit the following from the browser */

http://127.0.0.1/cgi-bin/oecgi.exe/INET_OI_XML?FILENAME=CUSTOMERS
 

/* to export last name and first name of CUSTOMERS in New Jersey */


http://127.0.0.1/cgi-bin/oecgi.exe/INET_OI_XML?CMD=LIST CUSTOMERS LNAME FNAME WITH STATE = 'NJ'
  • guides/programming/programmers_reference_manual/inet_oi_xml.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1