Search code examples
xmlxslt

Preferred file extension for XSLT documents


Is there a preferred file extension for XSLT documents?

Both .xsl and .xslt are used frequently (where .xsl is more popular).

But is there any recommended / authoritative / best practice guideline for this?


Solution

  • The XSLT 2.0 specification registered the MIME Media Type application/xslt+xml https://www.w3.org/TR/xslt20/#xslt-mime-definition, saying that 'XSLT documents are most often identified with the extensions ".xsl" or ".xslt"'. I would say it mostly depends on what works best for you and your environment and whether you can configure for instance your web server to make sure it associates the right MIME type with the suffix/file extension you use for your XSLT documents. But I think in practice .xsl with the MIME type text/xsl might still have the best interoperability.