And I have the same problem reading through Python, especially when looking for bugs. My inner C programmer keeps not seeing }s and thinking that maybe I didn't terminate some block where I meant to and that must obviously be the problem...
I thought the use of whitespace in Python was inspired, but I've never had to actually use it, so I don't know if I'd actually be able to get to grips with it...
They are likely using a validating DOM parser. The parser will either provide the loaded XML as an object model, fully formed, or it will fail. This is certainly the easiest way to load XML, though it is also the most memory-hoggish manner and you can't really try to do error recovery.
At minimum, it will enforce correct XML structure. At the other end, it could be extremely detailed if there is a DTD associated with it--and they could associate one at runtime even if there isn't one specified in the XML file. It's one quick way of doing wholesale validation without having to manually check the data for consistency.
Comments 5
Reply
I don't understand much of this but, I'll sit quietly with you while you work out the problems and maybe we can talk awhile.
*smile*
Reply
And I have the same problem reading through Python, especially when looking for bugs. My inner C programmer keeps not seeing }s and thinking that maybe I didn't terminate some block where I meant to and that must obviously be the problem...
Reply
Reply
They are likely using a validating DOM parser. The parser will either provide the loaded XML as an object model, fully formed, or it will fail. This is certainly the easiest way to load XML, though it is also the most memory-hoggish manner and you can't really try to do error recovery.
At minimum, it will enforce correct XML structure. At the other end, it could be extremely detailed if there is a DTD associated with it--and they could associate one at runtime even if there isn't one specified in the XML file. It's one quick way of doing wholesale validation without having to manually check the data for consistency.
Reply
Leave a comment