Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Reading a particular xml

by bitingduck (Chaplain)
on Aug 15, 2015 at 02:17 UTC ( [id://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 (Chancellor) 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.

    Alexander

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found