Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: Reading a particular xml

by bitingduck (Chaplain)
on Aug 15, 2015 at 02:17 UTC ( #1138663=note: print w/replies, xml ) Need Help??

in reply to Re: Reading a particular xml
in thread Reading a particular xml

I don't do much JSON, but the requirement for XML is to die on errors. No guessing, don't be polite about it, just up and die. CSV is a little fuzzier, but I tend to think it's not a bad idea to die on bad CSV. When I try to read CSV with the settings a little bit wrong, I tend to get something so horrific that I prefer that the reader just die.

HTML is a different story - there's enormous amounts of bad html out there and the convention unfortunately is that browsers will tolerate it. In a fair bit of screen-scraping, I haven't really run into problems with HTML parsers barfing, but I think I'm also mostly reading machine-generated HTML (though without guarantees that it's any good).

Replies are listed 'Best First'.
Re^3: Reading a particular xml
by afoken (Abbot) on Aug 15, 2015 at 09:29 UTC
    the requirement for XML is to die on errors. No guessing, don't be polite about it, just up and die.

    I'm no big fan of XML, but I think this is the biggest strength of XML and related tools. Either your XML is well-formed, or your tools start to complain. Tools that generate tag soup instead of XML and name it XML are just broken and need to be fixed or must stop calling their output XML.


    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1138663]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-06-18 08:04 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (109 votes). Check out past polls.