Language Namespaces

MXHX defines two special namespaces that represent core Haxe types and special language tags.

Each MXHX document may define exactly one language namespace. It is not allowed for an MXHX document to define more than one language namespace.

Basic Namespace

The basic namespace represents MXHX documents that are purely declarative. Haxe code must be defined in the class that uses the MXHXComponent.build() macro, or with the value returned by calls the MXHXComponent.withMarkup() or MXHXComponent.withFull() functions.

xmlns:mx="https://ns.mxhx.dev/2024/basic"

MXHX namespace

The full MXHX namespace allows a mix of declarative and imperative content. It is considered experimental at this time, so use at your own risk. This namespace allows adding inline event listeners to objects, and it supports data binding syntax.

xmlns:mx="https://ns.mxhx.dev/2024/mxhx"

You may see the following warning when using this namepace

Namespace 'https://ns.mxhx.dev/2024/mxhx' is experimental. Using namespace 'https://ns.mxhx.dev/2024/basic' instead is recommended

To disable this warning, add the mxhx_disable_experimental_warning define to your compiler options.

In an .hxml file:

-D mxhx_disable_experimental_warning

In an OpenFL project.xml file:

<define name="mxhx_disable_experimental_warning"/>