On Thu, Oct 24, 2002 at 03:13:09PM +0200, Kris Boulez wrote:
> What is peoples preferred module for writing XML (files) from within
> Perl ? The data is read by a perl script from different (heterogeneous) 
> sources and stored internally in a tree of objects.
> 
> I looked around a bit and saw XML::Writer being mentioned a lot. Is it
> this what most people are using ?

When I needed to write out some XML at work for reading by
someone's Java application (Not that what reads it should
matter) I had a play with XML::Writer to start with, but
kept having problems with it dumping illegal characters into
the XML.  Hmm.

Ended up using the XML::LibXML module, a very different
approach in that XML is produced as a tree and then written
out all at once rather than line-by-line.  This did have the
advantage that I can't think how I could force it to produce
invalid XML, and I had a lot less conditional logic to deal
with.  On the downside it naturally used up more memory, but
since I wasn't dealing with overly huge datafiles this
wasn't too much of an issue for me.


Paul Golds



Reply via email to