Hi Monks,

I'm a module novice, for the most part. I'm looking through the plethora of XML modules on CPAN, and thought I might see if anyone had suggestions. I need a module for building XML files from scratch. It (probably) doesn't need to read or modify existing XML files. My input is flat text files, and my program will only read them, build some kind of data structure, and output 1 largish (~5-10MB) XML file. I am looking for a module where building the XML data structure is as headache-free as possible, and of course one that can handle the file size (if that is even an issue at this size). Any recommendations are appreciated, and meanwhile I'll keep looking through CPAN. Thanks.

~rebugger~

*Edit: Thanks everyone for your suggestions. I'm checking them all out. I'll add a little extra information to the mix so people still wanting to add anything don't have to do as much of the "if this is what you want, then..." game. The XML has to be a certain format. I have a fixed DTD file I need to conform to (no XSL unless I write one, and it'd probably only be used in my program). The XML is the input for catalog software. Order of elements is important (it is kind of HTML-like) so I don't want it re-sorting. I am taking CSV files containing product data and building them into a catalog. This only needs to be done once, as it will be loaded into our catalog software database and edited in the software. The only data is text and numeric, nothing binary or otherwise fancy.

Ex. XML:

<catalog media_no="123456AB"> <title>Tool Catalog</title> <section id="s1000001" sort="1000001"> <title>Section 1</title> <section id="s0000001" sort="1"> <title>Hoses</title> <article id="a6543210"> <title_1>Air Hose</title_1> <title_info_1>Warranty: Nine Months</title_info_1> <list style="bulleted"> <title>Air Hose</title> <list_item>Rugged bend restrictor</list_item> <list_item>Max working pressure: 350 PSI</list_item> </list> </article> </section> </section> </catalog>

In reply to Module for XML output by rebugger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.