XML output with WinRunner – 3

Categories: Source codeXML Data

Root page: Service Functions – XML

Parent page: Service Functions – XML / WinRunner

Write child comment

public function xml_comment_write(in xml_file, in comment_str) {
 auto rc;
 if (xml_write_mode) {
 rc = file_open(xml_file, FO_MODE_APPEND);
 if (rc != E_OK) return(rc);
 file_printf(xml_file, "%s\r\n", node_indent & " " & "<!--"&comment_str&"-->"); 
 file_close(xml_file);
 }
 else {
 dump_printf("%s\r\n", node_indent & " " & "<!--"&comment_str&"-->"); 
 }
 return(E_OK);
}

Write XML body text

public function xml_text_write(in xml_file, in text_str) {
 auto rc;
 if (xml_write_mode) {
 rc = file_open(xml_file, FO_MODE_APPEND);
 if (rc != E_OK) return(rc);
 text_str = xml_str_norm(text_str);
 file_printf(xml_file, "%s\r\n", node_indent & " " & text_str); 
 file_close(xml_file);
 }
 else {
 text_str = xml_str_norm(text_str);
 dump_printf("%s\r\n", node_indent & " " & text_str); 
 } 
 return(E_OK);
}

Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by the author is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.