in reply to XML Parsing Suggestions?

*blinks* What have you tried?

Personally, I always use XML::Parser in Stream mode, but that's because the tasks I've used XML for have lent themselves to that mode of thinking. I have never had to do any of those tasks, which makes me feel that this is somewhat homework-ish. If I ever did, I would get my employer to provide a commercial tool, similar to XMLSpy.


  • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
  • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"

Replies are listed 'Best First'.
Re^2: XML Parsing Suggestions?
by Anonymous Monk on May 10, 2005 at 18:13 UTC

    *blinks* Nothing, yet. =) There are so many XML modules out there that I was just looking for recommendations as to which one(s) I should learn first for the kind of tasks I'm being asked to do. Opinions will vary from person to person I'm sure, but I thought some suggestions as to what other folks found most helpful might help me get my bearings. I did play around briefly with XML::Simple and XML::Parser in Object mode once a few months ago, but that was before my boss actually asked me to start dealing with XML documents and I didn't get a good feel for either of them in the limited time I had to play.

    Thanks for the XML::Parser in Stream mode suggestion. Is it possible to deal with comments in Stream mode? I thought the documentation made it sound like comments were basically ignored.

      Comments aren't useful data. If they were, they wouldn't be comments. :-)

      But, yes, you can parse comments in Stream mode. (If you couldn't, you couldn't get at them in any other mode as all XML::Parser modes are implemented as Stream mode.) The Comment handler (which is readily visible when you read the documentation is probably what you're looking for.


      • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
      • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"