On 27/10/2017 19:06, Bernard Peek wrote:

It is then up to the calling script (get_iplayer.pl) to decide what
action to take in response the action taken by the parser.  It is not
adequate just to allow XML::LibXML to display "parser error" and take
no further action.

Even though that's what the XML standard says IS the correct action?


PMFJI

I built data transfer standards for the UK's outdoor advertising industry. I deliberately chose to use XML based standards because it enabled automatic validation of data files. The standards were quite specific. All automated systems were required to refuse any files not compatible with the DTD I had on my web server. Data providers were expected to prevalidate any files they sent to any other company.

This was my main argument for switching to XML from flat-files.

If you are both right about the strictness of the standard, and I have to defer to your superior knowledge, why does XML::LibXML have options for recovery and validation? According to http://search.cpan.org/dist/XML-LibXML/lib/XML/LibXML/Parser.pod#PARSER_OPTIONS and
http://search.cpan.org/dist/XML-LibXML/lib/XML/LibXML/Error.pod
it also has a choice of Verbose and Quiet error handlers. Authors can use their own error handlers, or remove the error handler altogether. An example given is recovery from a missing closing tag. I have not seen a definition of fatal error. Is a spurious NUL a fatal error? I suspect it is less serious than a missing closing tag. It is easy to recover from; you just ignore it. Subject to what anyone may tell me, I would have thought non-matching tags would be more likely to be a fatal error.

It must be remembered that an important function of XML, in contrast to other mark up languages, is that it is human readable as well as machine readable.

Error recovery must always be appropriate for the importance of integrity of the data and the probability of errors. I can understand there are applications where strict compliance is necessary, but subtitles does not seem to me to be one of them.

Subtitles for this film used to work with XML::Simple. A problem only occurred with the move to XML::LibXML to support coloured subtitles. Is it possible to configure XML::LibXML to be as error tolerant as XML::Simple?

Best wishes
Richard





_______________________________________________
get_iplayer mailing list
get_iplayer@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer

Reply via email to