in reply to Re: xml/html detection script
in thread xml/html detection script

You'd also have to account for other XML Content-types, such as application/xml, application/xhtml+xml, application/rdf+xml, and so on.

Something like this might work:

if ($content_type =~ m!(application|text)/(.*\+)?xml!) { # Treat as XML }