| 1 |
# An minimal example showing how to use the python doxmlparser module to read |
| 2 |
# the XML output generated by doxygen for a project and dump it to the output again. |
| 3 |
|
| 4 |
import sys |
| 5 |
|
| 6 |
import doxmlparser |
| 7 |
|
| 8 |
# process a compound file and export the results to stdout |
| 9 |
def parse_compound(inDirName,baseName): |
| 10 |
doxmlparser.compound.parse(inDirName+"/"+baseName+".xml",False) |
| 11 |
|
| 12 |
# process the index file and export the results to stdout |
| 13 |
def parse_index(inDirName): |
| 14 |
rootObj = doxmlparser.index.parse(inDirName+"/index.xml",False) |
| 15 |
for compound in rootObj.get_compound(): # for each compound defined in the index |
| 16 |
parse_compound(inDirName,compound.get_refid()) |
| 17 |
|
| 18 |
def usage(): |
| 19 |
print("Usage {0} <xml_output_dir>".format(sys.argv[0])) |
| 20 |
sys.exit(1) |
| 21 |
|
| 22 |
def main(): |
| 23 |
args = sys.argv[1:] |
| 24 |
if len(args)==1: |
| 25 |
parse_index(args[0]) |
| 26 |
else: |
| 27 |
usage() |
| 28 |
|
| 29 |
if __name__ == '__main__': |
| 30 |
main() |
| 31 |
|