How to write to an XML File

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rtr
    New Member
    • Oct 2006
    • 3

    How to write to an XML File

    Hi!
    I've to write the contents of an URL to an XML file. The URL is :

    [URL="http://www.cricinfo.co m/australia/content/player/8608.html"]

    This page has statistics like "Batting and fielding averages", "Bowling averages". I've to write these to an XML file using Perl. I'm a C++ Programmer. I've no idea about this. Can any one tell me how to do this?
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Unfortunately I have not done tons with XML, but looking at the site you have, you are going to have to find away to parse out the values that you are looking for. For that you could start by looking at the HTML::Parser module. Then you could use XML::Simple to manage the XML file.-

    Hope that is a nudge in the right direction.

    Regards,

    Jeff

    Comment

    • Oralloy
      Recognized Expert Contributor
      • Jun 2010
      • 988

      #3
      rtr,

      If you look on CPAN, there are a good number of XML processing modules. They vary in complexity and capability, depending on what you're trying to accomplish.

      I searched for XML and got quite a list of available modules. I'd recommend looking at the XML::Trivial module and see if that suits your needs.

      If not, then hunt around. Read the documentation. Most of the modules give small programming examples, which is how I do my first cut evaluation of things in CPAN.

      Good luck.

      Comment

      Working...