MPS 2021.2 Help

XML language

The jetbrains.mps.core.xml language is designed to model closely XML documents in MPS. The language aims at being a 1:1 match to plain XML and is generated into textual XML files.

Structure

The XmlFile root element should be used to represent an XML file.

Xml1

It contains a single XmlDocument node, which itself holds one or more prolog entries and a root xml element:

Xml2

There are several types of prolog elements to choose from and customize:

Xml3

Use the Enter key to separate entries in the prolog, either within the same line or across multiple lines.

Editing

The elements, their attributes and values can then be entered naturally. The XML-specific symbols, such as e.g. '<', '>', '=', 'space', "&", are recognized as delimiters and the automatically invoked transformations will correctly insert proper instances of the desired concepts - XmlElement, XmlAttribute, XmlTextXmlTextValue,  XmlEntityRef, XmlEntityRefValue, XmlComment and other. Code-completion should assist you to complete unfinished elements with little effort.

Xml4

Generation

The language is transformed into textual XML using the TextGen aspect.

Xml5

Last modified: 14 September 2021