At 2:08 PM -0500 10/27/02, Emmanuel. M. Decarie wrote:
Hello,I'm trying to process the bookmarks.xml file created by the Chimera webbrowser. If you have Chimera, this file is at ~/Library/Application Support/Chimera/Profiles. What I want is to create a very simple html page from bookmarks.xml. I'm using XML::Twig for that, but I have found a strange behavior and after perusing the documentation for XML::Twig<http://www.xmltwig.com/>, I didn't see an answer. I know that I could contact the author, but I rather check here first.
<snip>
I don't know XML::Twig, but I suspect the issue you're having is not a direct decision from XML::Twig.As you see, it look like XML::Twig is processing from inward to outward, so all the bookmark nodes are processed before the folder nodes, so the handler formatbookmark is called before formatfolder. I'm surprise by this behavior, but maybe I'm missing something here.
I imagine that XML::Twig uses the standard Perl XML parser, which is a SAX parser rather than a DOM parser. That means that your handler events are going to get called as the parser encounters them - not when it has processed the full document. Which means that your 'formatfolder' is going to only get called when the parser encounters '</folder>' and not when it encounters '<folder>', or in some way that it could tell where the beginning of the '</folder>' tag was.
-Jeff Lowrey
