602SQL Documentation Index  



mixed wb_get_XML_form( resource connection, string xml_form_ref [, string xml_data] )


Identifier of the open connection, returned by the wb_connect or wb_pconnect function.
Reference to a XML form.
XML source containing data for the XML form.

Since version



This function returns XML form text, eventually filled with specified data. It is used in scripts that fill 602XML Filler.

The xml_form_ref parameter can have two formats. If it is in the object_name preceded by an asterisk format (i.e. *object_name), an object of this name and of XML form type is searched in the open application; otherwise the XML form definition is read directly from this parameter. This function is capable to recognize whether the XML definition is in plain text (.FO format) or compressed (.ZFO format) and it returns the form in the same format.

If the xml_data parameter is not specified, form definition is used as read from the database or variable. If data are specified (usually as an output from the wb_export_to_xml_buffer function), they are appended to the file in such way that they do not disturb form digital signature.


In case of success, it returns XML form source text (eventually compressed), in case of an error it returns FALSE.



If an error occurs in a script, the output can be redirected to the error form with error number and data (as variables).

function Send_error_form($err_num){
//send Error_form to Filler
  global $connection;
// get XML data from DAD directing only to client variables
  if (( $err_xml_data = wb_export_to_xml_buffer($connection, '*err_dad', NULL, array(
       "err_num" =>  array("type" => ATT_INT32,"out" => FALSE,"value" => $err_num),
       "err_date" => array("type" => ATT_DATE ,"out" => FALSE,"value" => time() )    )
     )) !== FALSE ) {
// fill as yet empty XML form with data from the previous step and send it to Filler (i.e. to standard output)
       if (( $xmlform = wb_get_xml_form($connection,'*Error_form',$err_xml_data)) !== FALSE) {
         print $xmlform;