[tpm] Good examples?

Matthew Phillips mattp at cpan.org
Mon Nov 11 11:48:04 PST 2013


For what its worth, XML::Simple _is_ built ontop of XML::SAX, which means
you can dictate the backend xml parser with XML_SIMPLE_PREFERRED_PARSER /
$XML::Simple::PREFERRED_PARSER for something faster, such as XML::LibXML or
Expat.

Also for next time, try taking a look at the
KeyAttr/ForceArray/ForceContent (and probably) other constructor opts, they
play a large role in how xml input is interpreted.

Cheers,
Matt


On Sun, Nov 10, 2013 at 9:56 PM, Fulko Hew <fulko.hew at gmail.com> wrote:

>
>
>
> On Fri, Nov 8, 2013 at 6:56 PM, James E Keenan <jkeen at verizon.net> wrote:
>
>> On 11/8/13 10:24 AM, Brandon McCaig wrote:
>>
>>> On Fri, Nov 8, 2013 at 9:30 AM,<arocker at vex.net>  wrote:
>>>
>>>> Does anyone know of a good explanation/example of how to use XML::SAX
>>>> anywhere online?
>>>>
>>>>
>>
>>> I have used XML::Simple with some success in the past. If you just
>>> need a proper XML parser for best practices, but don't need something
>>> robust, then it's probably an ideal option. Of course, taking the time
>>> to learn the larger, feature-rich modules will translate to larger
>>> projects later on, but XML::Simple will probably get you to a solution
>>> faster.
>>>
>>
>>
>> True.  But please note the qualifications the maintainer provides here:
>> http://search.cpan.org/~grantm/XML-Simple-2.20/lib/
>> XML/Simple.pm#STATUS_OF_THIS_MODULE
>>
>>
> I too read that note, but used the module anyway because
> I thought it was the easiest module to use with the simplest
> (most understandable) documentation.  Also the fact that
>  (I think) it was a pure Perl solution.
>
> It met my needs, but encountered an issue where the hash/object
> it created had (what I considered to be a different/inconsistent
> structure depending on whether
>
> the XML contained empty attributes or not.
>
> There wasn't an option for XML::Simple, so I wrote a post-processor
> fix-up to make the resultant structure consistent.
>
> Other than that, I thought it was great.
>
> [Postscript}  A coworker needed to do some XML recently, he started
> with XML::Simple, because I had experience, and ... it was simple.
> Once he had a working app, he moved to a different module that
> processed his 1+ gig XML 10+ times faster.
>
>
>
>
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20131111/68fc4ed5/attachment-0001.html>


More information about the toronto-pm mailing list