Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Why oh why is working with XML so bloomin' difficult in Perl?

by jfroebe (Vicar)
on Jan 19, 2009 at 04:25 UTC ( #737208=note: print w/ replies, xml ) Need Help??


in reply to Re: Why oh why is working with XML so bloomin' difficult in Perl?
in thread Modified title: The structures created by many of the XML parsers in Perl appear unnecessarily deep in levels...

LOL! Don't forget the rusty tiddly winks. ;-) It is a difficult thing to do to work with XML in any language. XML::Simple as mentioned earlier seems to be perfect for simpler XML documents/streams. I'm not certain how effective using Rules will be with large complex documents. There is only one way to find out though... thanks everyone for all the suggestions.

Jason L. Froebe

Blog, Tech Blog


Comment on Re^2: Why oh why is working with XML so bloomin' difficult in Perl?
Re^3: Why oh why is working with XML so bloomin' difficult in Perl?
by Jenda (Abbot) on Jan 19, 2009 at 12:24 UTC

    The problem with XML::Simple is that unless you fiddle with ForceArray and ForceContent the resulting data structure is not consistent. If some tag sometimes has text content and attributes and sometimes only the content, you get a hash once and a scalar later. If some tag is repeated within another tag once, but occurs only once the other time, you get array of hashes/scalars the first time and one hash/scalar the second.

    If you know your data you can set the XML::Simple's options accordingly. Or you can ask XML::Rules to infer the rules from either the DTD or a (few) example(s) and obtain a consistent datastructure almost identic to the one created by a well set XML::Simple.

    How effective are Rules with large documents depends on the rules. That's what specifies whether you keep all the data from the document or whether you filter the bits you do not need as you go or process parts of the XML and forget the data you no longer need.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://737208]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-12-25 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls