Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) 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

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

Good luck


In reply to Re^8: XML::Twig traversing tree and storing in an array by Anonymous Monk
in thread XML::Twig traversing tree and storing in an array by jccunning

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-20 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found