What is MIME type "application/relax-ng-compact-syntax"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

application/relax-ng-compact-syntax describes a file format used to write Relax NG schemas in a compact, easier-to-read notation.
It is a way to define the rules and structure for XML documents.
Developers use it to validate XML data without dealing with more complex XML-based schema definitions.
Files using this MIME type typically have an extension like RNC.
This MIME type ensures that systems and applications handle these schema files properly and know how to process their validation rules.
For more technical details, visit relaxng.org.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: application/relax-ng-compact-syntax    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="application/relax-ng-compact-syntax">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'application/relax-ng-compact-syntax');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the purpose of the application/relax-ng-compact-syntax MIME type?

This MIME type is used to identify RELAX NG schemas written in the Compact Syntax. Unlike the verbose XML syntax, this format uses a concise, non-XML notation to define the structure and validation rules for XML documents.

Which file extension is associated with this MIME type?

The standard file extension for this content type is .rnc. You can learn more about how this extension is used at rnc.

How do I configure Apache to serve .rnc files correctly?

To ensure your Apache server sends the correct headers, add the following line to your .htaccess file or main configuration: AddType application/relax-ng-compact-syntax .rnc.

How do I set up Nginx to handle application/relax-ng-compact-syntax?

In your Nginx configuration (usually nginx.conf or mime.types), add the mapping inside the types block: types { application/relax-ng-compact-syntax rnc; }. Restart the server to apply the changes.

What is the difference between RNC and RNG files?

RNC files use application/relax-ng-compact-syntax and are written in a human-readable, C-like format. RNG files use XML syntax (often served as application/xml) to define the same rules but are more verbose.

Can I convert files with this MIME type to standard XML schemas?

Yes, tools like Trang or Jing can convert .rnc files into XML-based RELAX NG (.rng) or W3C XML Schema (.xsd) formats. This is useful if your validation tool does not natively support the compact syntax.

Is application/relax-ng-compact-syntax safe?

These files are plain text configuration files and are generally safe. However, when using them to validate XML, ensure your XML parser is secure against vulnerabilities like XXE (XML External Entity) attacks.

What software can open or edit these files?

You can edit these files with any text editor, but specialized tools like Oxygen XML Editor or Emacs (with nxml-mode) provide syntax highlighting and validation specifically for the RELAX NG Compact Syntax.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.