Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm writing a script that will turn a directory tree (after applying various filters and so on) into an xml structure, and from there into html (the same xml will also be used by other tools so I need this layer of abstration). I'm searching cpan, and here, but not finding a good match. I'd like to use a SAX-like model, where events are raised for directories, text files and binary files so I can apply rules and filters to get the right output.
Does anything similar exist? Am I missing an obvious quicker way to get to the goal.
What I have now uses File::Find, but I'm not having fun with it and it (my code) is not pretty :) Thanks Sam Sam
  • Comment on Directory tree to XML (Event based directory crawler?)

Replies are listed 'Best First'.
Re: Directory tree to XML (Event based directory crawler?)
by bobdeath (Scribe) on Apr 30, 2003 at 16:13 UTC
    Have you taken a look at XML::Directory. It seems to do everything you want.
Re: Directory tree to XML (Event based directory crawler?)
by samiam (Initiate) on Apr 30, 2003 at 16:10 UTC
    oops. Didn't realise I wasn't logged in when I posted this.

    I'm using XML:XMLLib to build the XML, and trying to just use the DOM methods(for the benefit of my colleagues who are java/python/c/vb people).. which is proving unweildy. So that requirement might get dropped in the name of getting this up and running.

    Anyhow, thanks for any pointers
    Sam