File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010from gvm .protocols .gmp import Gmp
1111from gvm .xml import pretty_print
12+ from lxml import etree
1213
1314
1415def check_args (args ):
@@ -51,9 +52,8 @@ def main(gmp: Gmp, args: Namespace) -> None:
5152 )
5253
5354 report_element = response .find ("report" )
54- pretty_print (report_element )
55- # get the full content of the report element
56- content = report_element .find ("report_format" ).tail
55+ # get the full content of the report element as bytestring
56+ content = etree .tostring (report_element .find ("report" ))
5757
5858 if not content :
5959 print (
@@ -64,16 +64,13 @@ def main(gmp: Gmp, args: Namespace) -> None:
6464 )
6565 sys .exit (1 )
6666
67- # convert content to 8-bit ASCII bytes
68- binary_base64_encoded_xml = content .encode ("ascii" )
69-
70- # decode base64
71- binary_xml = b64decode (binary_base64_encoded_xml )
67+ # decode content
68+ dcontent = content .decode ("utf-8" )
7269
7370 # write to file and support ~ in filename path
7471 xml_path = Path (xml_filename ).expanduser ()
7572
76- xml_path .write_bytes ( binary_xml )
73+ xml_path .write_text ( dcontent )
7774
7875 print ("Done. xml created: " + str (xml_path ))
7976
You can’t perform that action at this time.
0 commit comments