xproc / Vnext

Assembly point for all issues for a next version of XProc
1 stars 0 forks source link

Allow special content-types values also in content-type attributes/options #54

Open xatapult opened 4 days ago

xatapult commented 4 days ago

The content-types attribute in the core-spec allows some special values with a well-defined meaning: xml, json, etc.

The content-type attribute/option however does not, which. While programming XProc I found myself often writing content-type="xml" because I simply wanted to load an XML document and did not really care what exact media type is assigned. Of course, this raised an error. But... why not?

Why don't we accept the special values for content-types also in content-type, for all those (often occurring) cases where you don't really care about the exact media type. Just assign the most generic one applicable. Of course we need to give them a specific meaning:

If we do this, we also need to change the definition of some error messages, at least XD0079.

ndw commented 3 days ago

Makes sense to me. I'd argue for application/xml though as text/* media types have an impliced character set, as I recall.