|P is for Practical|
Re^8: XML::Twig traversing tree and storing in an arrayby Anonymous Monk
|on Aug 08, 2012 at 10:06 UTC||Need Help??|
Take C++ API generated from Doxygen into perl module output, convert to xml, filter xml, then put old and new version of API into hashes or arrays so I can compare and report what has changed in each class, namespace, etc. and new classes that have been added.
Um, how about you forget about xml all together?
You swap one giant tree type structure for another another with XML on top -- XML complicates it doesn't simplify :)
What I have so far. Must be better way to put output of test files into separate hashes and arrays instead of duplicating everything like I did.
Well, the code I gave you already did that, sure the arrays were stuffed in a hash, and the hashes were stuffed in another hash, but its all there. I even showed you how to retrieve any part you want, and say, put it into any hash you want.
IMHO, a better idea, is to ditch xml, and learn to work with complex data structures (references) using straight perl, or use Data::Diver, or even JSON::Path, to get at your data -- you'll have to wrap your head around it one way or another, might as well do it now, without the headache of xml
You might start by writing a single function called getClasses that traverses $doxydocs and pulls out classes (hashrefs), then getMembers, getParameters ... then a function called diffClasses that does the diff, or it might utilize diffMembers / diffParameters ... or even Data::Difference / Data::KeyDiff