xmlutils.py
xmlutils.py copied to clipboard
Needs a 'tag' scanner for xml files
Rather than assuming the xml tag structure, the script needs to essentially scan the xml file BEFORE outputting the contents into CSV so that the column headers can be created first. This will ensure that all tags within the CSV file are accounted for. I have some files you can use for testing this if needs be.
Could the process add a blank line at the beginning of the CSV output file and collect the list of tags as it parses the file. Once parsing is complete, the blank line could get overwritten using the list of tags collected during parsing. This would eliminate the need for multiple passes over the file. Just an alterate idea to the 2-pass approach.