-1

I have an XML file, with some format. I want the data to be modified in some way I want. I feel XML::Twig is the way to do it.

I want to know if there is any other better alternative?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Swati
  • 27
  • 1
  • 1
  • 2
    I bet for some definition of "better" there is some alternative. Yes. – innaM Oct 23 '09 at 13:40
  • Are you asking for the best XML parser for Perl? It sounds to me like you are. In that case, this question is a duplicate. – Sinan Ünür Oct 23 '09 at 13:52
  • Not exactly parsing. See i know parsing dude. Actually i want to read the data, modify it as i want then write to it another XML file – Swati Oct 23 '09 at 13:57
  • 3
    OK dood .. then read the data, modify it and write the output. What part of that is giving you problems? – Sinan Ünür Oct 23 '09 at 14:00
  • 2
    Swati, I see you only joined today. Just a quick tip -- suggest you look at the faq tab and the [meta](http://meta.stackoverflow.com/) site. You will get a log more cooperation if you phrase your question clearly and show at least some effort in solving it yourself! – heferav Oct 23 '09 at 15:31
  • You don't even have to have a look at the FAQ. Just picture yourself in our shoes. How would you try to answer a question as that? – innaM Oct 23 '09 at 16:00

1 Answers1

10

You will probably find the XML::Twig is an ideal tool for the task and there have been plenty of questions/answers on Stack Overflow that seem to reaffirm this:

You may also find it helpful to know that the author of XML::Twig does answer questions on this site: Mirod.

However if you really are looking for an alternative then have a look at XML::LibXML. This module is based on libxml2 library (XML::Twig is written on top of XML::Parser which uses the expat library).

Mirod himself lists alternatives to XML::Twig in his FAQ.

AndyG
  • 39,700
  • 8
  • 109
  • 143
draegtun
  • 22,441
  • 5
  • 48
  • 71