<?xml version="1.0" encoding="windows-1252"?>
<node id="131953" title="Re: XM-Hell" created="2001-12-14 12:26:36" updated="2005-07-30 12:13:49">
<type id="11">
note</type>
<author id="9346">
mirod</author>
<data>
<field name="doctext">
&lt;p&gt;In this case [XML::Simple] will not work, as your XML includes mixed content (text with tags inside, such as &lt;code&gt;&lt;p&gt;foo &lt;b&gt;bar&lt;/b&gt; baz&lt;/p&gt;&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;To make sense of the various XML modules you can have a look at &lt;a href="http://www.xml.com/pub/au/83"&gt;Kip Hampton's excellent column&lt;/a&gt; on &lt;a href="http://xml.com"&gt;xml.com&lt;/a&gt;, look at my old &lt;a href="http://www.xml.com/pub/a/2000/04/05/feature/index.html"&gt;Processing XML with Perl&lt;/a&gt; article or start hanging out on the &lt;a href="http://listserv.activestate.com/mailman/listinfo/perl-xml"&gt;perl-xml  mailing list&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The recent trend in XML processing with Perl is to move away from [XML::Parser] based modules and to use more modules based &lt;a href="http://www.xmlsoft.org"&gt;libXML 2&lt;/a&gt;, the GNOME XML library. That said a lot of the "good ole" XML modules would work just fine in your case: [XML::Parser] of course, but also [XML::Twig] (of course!), probably [XML::PYX], as suggested by [Davorg] XML::XPath would work too, and [XML::DOM] would work too (if you decide to use it you might want to check out &lt;a href="http://www.xmltwig.com/domtwig/"&gt;XML::DOM::Twig&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;BTW the reason XML::Parser is sortta frowned upon these days is that it has a non-standard interface (newer modules use standard SAX or DOM interfaces, XML::Parser predates both). Those interfaces are sounder and more common, which means that for example you can read CSV data and process it with XML tools if you use a CSV parser with a SAX output such as Illya Strin's &lt;a href="http://search.cpan.org/search?dist=XML-SAXDriver-CSV"&gt;XML::SAXDriver::CSV&lt;/a&gt; .&lt;/p&gt;
&lt;p&gt;Last but not least Matt Sergeant would kill me if I failed to mention his new [cpan://XML::SAX::PurePerl], which is, surprisingly, a SAX parser written in pure Perl, which means you don't have to install external libraries such as expat or libXML 2, which can be a pain on some systems.&lt;/p&gt;</field>
<field name="root_node">
131918</field>
<field name="parent_node">
131918</field>
</data>
</node>
