ace.tools.xml.utils
- class ace.tools.xml.utils.XMLExtractor[source]
Bases:
object- extract_element_data(element, parent_path='')[source]
Recursively extract data from XML elements including tc attributes.
- extract_from_file(file_path: str) List[Dict][source]
Extract all data from a single XML file. Returns list of dictionaries with path, values, tc.
- read_existing_csv(csv_file: str) Dict[str, Dict][source]
Read existing CSV and return a dictionary with path as key. Values and tc are stored as sets to handle multiple occurrences without duplicates.
- merge_data(existing_data: Dict, new_rows: List[Dict]) List[Dict][source]
Merge new data with existing data using sets to avoid duplicates.
- process_directory(directory: str, output_csv: str)[source]
Process all XML files in a directory and update CSV file. Updates existing paths with new values/tc as lists.