algebraixlib.import_export.xml module¶
Import data from XML.
-
algebraixlib.import_export.xml.import_xml()[source]¶ Import the file
xml_file_or_filepathas XML file and return nested relations.Parameters: - xml_file_or_filepath – A file path or a file object of the file to be imported.
- convert_numerics – If
True, numeric values (integers, floating-point numbers) are imported as number types. IfFalse(default), everything is imported as string.
Returns: A nested relation starting with a relation that contains a single couplet that represents the single XML root element.
-
algebraixlib.import_export.xml.xml_to_str(xml_file_or_filepath, indent_text=' ', truncate=True, max_line_len=95, pre_len=0, post_len=0)[source]¶ Return an XML file or string into a consistently formatted XML string.
Parameters: - xml_file_or_filepath – A file path or a file object to be converted.
- indent_text – A string of characters used as indent.
- truncate – When
True, truncate converted text usingmax_line_len. - max_line_len – The maximum number of characters per line when truncation is used.
- pre_len – The maximum length, in characters, the first part of the converted string is
allowed to be. (The part between
pre_lenandpost_lenis replaced with a line that contains an ellipsis.) Ignored if 0 or ifpost_lenis 0. - post_len – The maximum length, in characters, the last part of the converted string is
allowed to be. (The part between
pre_lenandpost_lenis replaced with a line that contains an ellipsis.) Ignored if 0 or ifpre_lenis 0.