Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^8: XML::Twig traversing tree and storing in an array

by Anonymous Monk
on Aug 08, 2012 at 10:06 UTC ( #986200=note: print w/ replies, xml ) Need Help??


in reply to Re^7: XML::Twig traversing tree and storing in an array
in thread XML::Twig traversing tree and storing in an array

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

See do/Including files/ Re^5: Evaluating subroutines from within data for better how-to load DoxyDocs.pm into your program

Good luck


Comment on Re^8: XML::Twig traversing tree and storing in an array

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986200]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-12-25 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls