MathML Media-type Declarations

W3C Group Note

More details about this document
This version:
https://www.w3.org/TR/2022/NOTE-mathml-media-types-20220721/
Latest published version:
https://www.w3.org/TR/mathml-media-types/
Latest editor's draft:
https://w3c.github.io/mathml-docs/mathml-media-types/
History:
https://www.w3.org/standards/history/mathml-media-types
Commit history
Editor:
Paul Libbrecht
Feedback:
GitHub w3c/mathml-docs (pull requests, new issue, open issues)
MathML 4 editors' draft
https://w3c.github.io/mathml/
MathML Core Level 1 editors' draft
https://w3c.github.io/mathml-core/

Abstract

This normative text registers three media types for MathML, application/mathml+xml, application/mathml-presentation+xml and application/mathml-content+xml, in conformance with [RFC4288] and [W3CRegMedia]. The media-types have been approved by IESG for registration with IANA as announced by IETF and are visible on the list of application media-types [MediaTypesList].

Status of This Document

This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.

This document was published by the Math Working Group as a Group Note using the Note track.

Group Notes are not endorsed by W3C nor its Members.

This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

The W3C Patent Policy does not carry any licensing requirements or commitments on this document.

This document is governed by the 2 November 2021 W3C Process Document.

1. Selection of Media Types for MathML Instances

MathML contains two distinct vocabularies. Presentation markup is for encoding visual presentation, and consists of the elements defined in Chapter 3 of the MathML specification. Content markup is for encoding mathematical meaning, and consists of the elements defined in Chapter 4 of the MathML specification. In addition, both the presentation and content vocabularies contain the math, semantics, annotation and annotation-xml elements. The MathML media types should be used as follows:

application/mathml-presentation+xml

MathML instances that consist solely of presentation markup.

application/mathml-content+xml

MathML instances that consist solely of content markup.

application/mathml+xml

Any valid MathML instance. Must be used for MathML instances that are a mix of presentation and content markup, or where the composition of an instance is not known or cannot be guaranteed.

Some MathML applications may import and export only one of these two vocabularies, while others may produce and consume each in a different way, and still others may process both without any distinction between the two. Internally, many MathML processors favor one vocabulary, and support the other vocabulary via conversion if at all. For example, computational software typically favors content markup while typesetting software generally favors presentation markup. By using separate media types for MathML instances consisting solely of presentation or solely of content markup, such processors can conduct negotiation for MathML representations in the preferred vocabulary. For example, consider two web services offering mathematical computation services such as a spreadsheet and a computer algebra system. Internally both prefer content markup, but by default, both generate presentation markup for output. In the absence of media type negotiation, a likely scenario for an exchange between two systems involves two conversions, content to presentation and back again. With negotiation, the conversions are eliminated. Similarly, a client with a MathML instance in one of the vocabularies might seek a web service that preferred that vocabulary.

MathML is commonly used in compound document settings, e.g. within HTML, where content is drawn from a variety of sources, and processed with multiple tools. In these cases, the composition of MathML expressions generally is not known or at least cannot be guaranteed by a user agent. Consequently, the application/mathml+xml type should be used, as it may be applied to any valid MathML expression. Since most applications involve data from untrusted sources, application/mathml+xml will commonly be appropriate to use as a default type, and all MathML processors are encouraged to accept it as a fallback to the more specific formats.

The media types described here may be applied to instances of all versions of MathML. MathML instances do not contain version numbers, so processors and producers must follow the normative backward compatibility behavior.

2. Media type for Generic MathML

This registration has been submitted to community review and has been approved by IESG for registration with IANA.

Type name

application

Subtype name

mathml+xml

Required parameters

None

Optional parameters

Same as charset parameter of application/xml as specified in [RFC7303]

Encoding considerations

The encoding considerations of application/xml as specified in [RFC7303] apply.

Security considerations

As with other XML types and as noted in [RFC7303] section 10, repeated expansion of maliciously constructed XML entities can be used to consume large amounts of memory, which may cause XML processors in constrained environments to fail.

Several MathML elements may cause arbitrary URIs to be referenced. In this case, the security issues of [RFC3986], section 7, should be considered.

In common with HTML, MathML documents may reference external media such as images, style sheets, and scripting languages. Scripting languages are executable content. In this case, the security considerations in the Media Type registrations for those formats shall apply. Similarly, MathML annotation elements may contain content intended for execution or processing. In the case where the processor recognizes and processes the additional content, or where further processing of that content is dispatched to other processors, additional security issues potentially arise. Since the normative semantics of the MathML specifications do not require processing of annotation elements, such issues fall outside the domain of this registration document.

MathML may be used to describe mathematical expressions intended for evaluation in computing systems. Because of the nature of mathematics, a seemingly innocuous expression may lead to a computation which does not terminate or is impractically large. This introduces the risk that computational processors in constrained environments may fail.

In addition, because of the extensibility features for MathML and of XML in general, it is possible that application/mathml+xml may describe content that has security implications beyond those described here. However, if the processor follows only the normative semantics of the MathML specifications, this content will be outside the MathML namespace and shall be ignored.

Interoperability considerations

The MathML specification describes processing semantics that dictate behavior that must be followed when dealing with, among other things, unrecognized elements and attributes, both in the MathML namespace and in other namespaces.

Because MathML is extensible, conformant application/mathml+xml processors must expect that content received is well-formed XML, but it cannot be guaranteed that the content is valid to a particular DTD or Schema or that the processor will recognize all of the elements and attributes in the document.

MathML instances do not contain version numbers, so processors and producers must follow the normative backward compatibility behavior described in the MathML specifications.

In computational contexts, the result of evaluating a MathML expression is system-specific, and is not guaranteed to be interoperable between systems.

Published specification

This media type registration is extracted from Appendix B of the Mathematical Markup Language (MathML) Version 3. specification but constitutes a specification in itself.

Applications that use this media type

Web browsers, rendering engines, formula editors, typesetting software, search robots, computing systems.

Additional information

Magic number(s): see [RFC7303]

File extension(s):

.mml

Windows Clipboard Name:

MathML

Macintosh file type code(s)

MML

Macintosh Universal Type Identifier code

public.mathml conforming to public.xml

Person & email address to contact for further information

Paul Libbrecht (member-math@w3.org). See the W3C Math Working Group home page for more information.

Intended usage

COMMON

Restrictions on usage

None

Author and Change controller

The MathML specification and this media-type registration are the products of the World Wide Web Consortium's Math Working Group. The W3C has change control over this media type registration.

3. Media type for Presentation MathML

This registration has been submitted to community review and has been approved by IESG for registration with IANA.

Type name

application

Subtype name

mathml-presentation+xml

Required parameters

None

Optional parameters

Same as charset parameter of application/xml as specified in [RFC7303]

Encoding considerations

The considerations of application/xml as specified in [RFC7303] apply.

Security considerations

As with other XML types and as noted in [RFC7303] section 10, repeated expansion of maliciously constructed XML entities can be used to consume large amounts of memory, which may cause XML processors in constrained environments to fail.

Several MathML elements may cause arbitrary URIs to be referenced. In this case, the security issues of [RFC3986], section 7, should be considered.

In common with HTML, MathML documents may reference external media such as images, style sheets, and scripting languages. Scripting languages are executable content. In this case, the security considerations in the Media Type registrations for those formats shall apply. Similarly, MathML annotation elements may contain content intended for execution or processing. In the case where the processor recognizes and processes the additional content, or where further processing of that content is dispatched to other processors, additional security issues potentially arise. Since the normative semantics of the MathML specification do not require processing of annotation elements, such issues fall outside the domain of this registration document.

MathML may be used to describe mathematical expressions intended for evaluation in computing systems. Because of the nature of mathematics, a seemingly innocuous expression may lead to a computation which does not terminate or is impractically large. This introduces the risk that computational processors in constrained environments may fail.

In addition, because of the extensibility features for MathML and of XML in general, it is possible that application/mathml-presentation+xml may describe content that has security implications beyond those described here. However, if the processor follows only the normative semantics of the MathML specification, this content will be outside the MathML namespace and shall be ignored.

Interoperability considerations

The MathML specifications describe processing semantics that dictate behavior that must be followed when dealing with, among other things, unrecognized elements and attributes, both in the MathML namespace and in other namespaces.

Because MathML is extensible, conformant application/mathml-presentation+xml processors must expect that content received is well-formed XML, but it cannot be guaranteed that the content is valid to a particular DTD or Schema or that the processor will recognize all of the elements and attributes in the document.

MathML instances do not contain version numbers, so processors and producers must follow the normative backward compatibility behavior described in the MathML specifications.

In computational contexts, the result of evaluating a MathML expression is system-specific, and is not guaranteed to be interoperable between systems.

This normative text does not record a file extension for the media type application/mathml-presentation+xml because we expect tools processing files with MathML inside to have sufficient information with the generic media-type (application/mathml+xml) while other content negotiation forms will take advantage of specific media-types.

Published specification

This media type registration is extracted from Appendix B of the Mathematical Markup Language (MathML) Version 3. specification but is a free-standing specification.

Applications that use this media type

Web browsers, rendering engines, formula editors, typesetting software, search robots, computing systems.

Additional information

Magic number(s): see [RFC7303]

File extension(s):

None

Windows Clipboard Name:

MathML Presentation

Macintosh file type code(s)

MMLp

Macintosh Universal Type Identifier code

public.mathml.presentation conforming to public.mathml (described above) conforming to public.xml

Person & email address to contact for further information

Paul Libbrecht (member-math@w3.org). See the W3C Math Working Group home page for more information.

Intended usage

COMMON

Restrictions on usage

None

Author and Change controller

The MathML specification and this normative text are the products of the World Wide Web Consortium's Math Working Group. The W3C has change control over this normative text.

4. Media type for Content MathML

This registration has been submitted to community review and has been approved by IESG for registration with IANA.

Type name

application

Subtype name

mathml-content+xml

Required parameters

None

Optional parameters

Same as charset parameter of application/xml as specified in [RFC7303]

Encoding considerations

The encoding considerations of application/xml as specified in [RFC7303] apply.

Security considerations

As with other XML types and as noted in [RFC7303] section 10, repeated expansion of maliciously constructed XML entities can be used to consume large amounts of memory, which may cause XML processors in constrained environments to fail.

Several MathML elements may cause arbitrary URIs to be referenced. In this case, the security issues of [RFC3986], section 7, should be considered.

In common with HTML, MathML documents may reference external media such as images, style sheets, and scripting languages. Scripting languages are executable content. In this case, the security considerations in the Media Type registrations for those formats shall apply. Similarly, MathML annotation elements may contain content intended for execution or processing. In the case where the processor recognizes and processes the additional content, or where further processing of that content is dispatched to other processors, additional security issues potentially arise. Since the normative semantics of the MathML specifications do not require processing of annotation elements, such issues fall outside the domain of this registration document.

MathML may be used to describe mathematical expressions intended for evaluation in computing systems. Because of the nature of mathematics, a seemingly innocuous expression may lead to a computation which does not terminate or is impractically large. This introduces the risk that computational processors in constrained environments may fail.

In addition, because of the extensibility features for MathML and of XML in general, it is possible that application/mathml-content+xml may describe content that has security implications beyond those described here. However, if the processor follows only the normative semantics of the MathML specifications, this content will be outside the MathML namespace and shall be ignored.

Interoperability considerations

The MathML specification describes processing semantics that dictate behavior that must be followed when dealing with, among other things, unrecognized elements and attributes, both in the MathML namespace and in other namespaces.

Because MathML is extensible, conformant application/mathml-content+xml processors must expect that content received is well-formed XML, but it cannot be guaranteed that the content is valid to a particular DTD or Schema or that the processor will recognize all of the elements and attributes in the document.

MathML instances do not contain version numbers, so processors and producers must follow the normative backward compatibility behavior described in the MathML specifications.

In computational contexts, the result of evaluating a MathML expression is system-specific, and is not guaranteed to be interoperable between systems.

This normative text does not record a file extension for the media type application/mathml-content+xml because we expect tools processing files with MathML inside to have sufficient information with the generic media-type (application/mathml+xml) while other content negotiation forms will take advantage of specific media-types.

Published specification

This media type registration is extracted from Appendix B of the Mathematical Markup Language (MathML) Version 3. specification but is a free-standing specification.

Applications that use this media type

Formula editors, search robots, computing systems.

Additional information

Magic number(s): see [RFC7303]

File extension(s):

None

Windows Clipboard Name:

MathML Content

Macintosh file type code(s)

MMLc

Macintosh Universal Type Identifier code

public.mathml.content conforming to public.mathml (described above) conforming to public.xml

Person & email address to contact for further information

Paul Libbrecht (member-math@w3.org). See the W3C Math Working Group home page for more information.

Intended usage

COMMON

Restrictions on usage

None

Author and Change controller

The MathML specification and this normative text are the product of the World Wide Web Consortium's Math Working Group. The W3C has change control over this normative text.

A. References

A.1 Informative references

[MediaTypesList]
Media Types. IANA (Internet Assigned Numbers Authority. Last checked on June 8th 2022. URL: http://www.iana.org/assignments/media-types/application/
[RFC3986]
Uniform Resource Identifier (URI): Generic Syntax. T. Berners-Lee; R. Fielding; L. Masinter. IETF. January 2005. Internet Standard. URL: https://www.rfc-editor.org/rfc/rfc3986
[RFC4288]
Media Type Specifications and Registration Procedures. N. Freed; J. Klensin. IETF. December 2005. Best Current Practice. URL: https://www.rfc-editor.org/rfc/rfc4288
[RFC7303]
XML Media Types. H. Thompson; C. Lilley. IETF. July 2014. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc7303
[W3CRegMedia]
Register an Internet Media Type for a W3C Spec. World Wide Web Consortium. January 2020. URL: https://www.w3.org/2020/01/registering-mediatypes.html