|
wb_import_from_XML_buffer | XML Transfer in PHP interface | Client variables description |
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; exit; }; } };
wb_import_from_XML_buffer | XML Transfer in PHP interface | Client variables description |