XML Schema Documentation

Table of Contents

top

Schema Document Properties

Target Namespace None
Version ${project.version}
Element and Attribute Namespaces
  • Global element and attribute declarations belong to this schema's target namespace.
  • By default, local element declarations belong to this schema's target namespace.
  • By default, local attribute declarations have no namespace.
Documentation Every XMIR document is essentially an XML document that contains objects found in a EOLANG program together with supplementary information, such as metas, license, and so on. The schema is used to validate the XMIR documents, which are generated by the EO parser. The schema defines the structure of the XMIR document, including the elements and attributes that are allowed, their types, and any constraints that must be satisfied. By validating the XMIR documents against this schema, developers can ensure that the documents are well-formed and conform to the expected structure. This validation process helps maintain the integrity and consistency of the XMIR documents and ensures that they can be processed correctly by other tools or systems that consume them.
Application Data The XMIR schema is used to validate the XMIR documents, which are generated by the EO parser.

Declared Namespaces

Prefix Namespace
xml http://www.w3.org/XML/1998/namespace
xs http://www.w3.org/2001/XMLSchema
Schema Component Representation
<xs:schema version="${project.version}" elementFormDefault="qualified">
...
</xs:schema>
top

Global Declarations

Element: program

Name program
Type program
Nillable no
Abstract no
XML Instance Representation
<program
name="fqn [1] ?"
ms="whole [0..1] ?"
time="xs:dateTime [0..1] ?"
version="non-empty [0..1] ?"
revision="xs:string (pattern = [0-9a-f]{7}) [0..1] ?"
dob="xs:dateTime [0..1] ?"
source="non-empty [0..1] ?">
Start All [1]
<listing> listing </listing> [0..1]
<comments> [0..1] ?
<comment> comment </comment> [1..*]
</comments>
<errors> [0..1] ?
<error> error </error> [1..*]
</errors>
<sheets> [0..1] ?
<sheet> sheet </sheet> [1..*]
</sheets>
<license> license </license> [0..1]
<metas> [0..1]
<meta> meta </meta> [1..*]
</metas>
<objects> [1]
<o> o </o> [0..*]
</objects>
End All
</program>
Schema Component Representation
<xs:element name="program" type="program"/>
top

Global Definitions

Complex Type: comment

Super-types: xs:string < non-empty (by restriction) < comment (by extension)
Sub-types: None
Name comment
Abstract no
Documentation Comments may be attached to objects in EO programs, but only to the highest-level formations. These comments provide additional context or explanations for the code, which can be useful for understanding the program's logic and intent. Comments are typically used to document the purpose of the code, describe complex logic, or provide other relevant information that can aid in code maintenance and readability.
Application Data The comment found attached to an object
XML Instance Representation
<...
line="whole [1]">
non-empty
</...>
Schema Component Representation
<xs:complexType name="comment">
<xs:simpleContent>
<xs:extension base="non-empty">
<xs:attribute name="line" type="whole" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
top

Complex Type: error

Super-types: xs:string < non-empty (by restriction) < error (by extension)
Sub-types: None
Name error
Abstract no
Documentation The element explains what kind of problem is found in the program, where exactly, and what is the severity of it.
Application Data The error found in the program
XML Instance Representation
<...
check="sheet [0..1] ?"
line="whole [0..1] ?"
severity="xs:string (value comes from list: {'critical'|'error'|'warning'}) [1] ?">
non-empty
</...>
Schema Component Representation
<xs:complexType name="error">
<xs:simpleContent>
<xs:extension base="non-empty">
<xs:attribute name="check" type="sheet"/>
<xs:attribute name="line" type="whole"/>
<xs:attribute name="severity" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="critical"/>
<xs:enumeration value="error"/>
<xs:enumeration value="warning"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
top

Complex Type: license

Super-types: xs:string < non-empty (by restriction) < license (by extension)
Sub-types: None
Name license
Abstract no
Documentation The element contains the entire text of the license found in the source code. This information is crucial for understanding the legal terms under which the code can be used, modified, and distributed. By including the full license text, developers and users can easily reference the licensing terms without needing to look up the original source. This practice helps ensure compliance with the license and provides transparency regarding the legal framework governing the code.
Application Data The entire license found in the source code
XML Instance Representation
<...>
non-empty
</...>
Schema Component Representation
<xs:complexType name="license">
<xs:simpleContent>
<xs:extension base="non-empty"/>
</xs:simpleContent>
</xs:complexType>
top

Complex Type: listing

Super-types: xs:string < non-empty (by restriction) < listing (by extension)
Sub-types: None
Name listing
Abstract no
Documentation The `listing` element contains the entire listing of the source code program, in EO language, as it was seen by the scanner. This element does not have any structure and may be omitted. However, it is recommended to provide the listing to simplify debugging and enable traceability. By including the full source code listing, developers can easily reference the original code, which helps in understanding the context of the program and aids in troubleshooting any issues that may arise during the processing or execution of the program.
Application Data The entire listing of the source code program, in EO
XML Instance Representation
<...>
non-empty
</...>
Schema Component Representation
<xs:complexType name="listing">
<xs:simpleContent>
<xs:extension base="non-empty"/>
</xs:simpleContent>
</xs:complexType>
top

Complex Type: meta

Super-types: None
Sub-types: None
Name meta
Abstract no
Documentation The element contains information about a meta found in the source code, before all objects. A "meta" in this context refers to metadata that provides additional information about the EO program. This metadata can include various details such as configuration settings, annotations, or other descriptive information that is not part of the main program logic but is essential for understanding, processing, or managing the program. Metas are typically used to convey information that can influence how the program is compiled, optimized, or executed. They can also be used for documentation purposes, to provide insights into the program's structure, dependencies, or other relevant attributes.
Application Data The meta found in the source code
XML Instance Representation
<...
line="whole [0..1]">
<head> xs:string (pattern = [a-z]+[a-z0-9]*) </head> [1]
<tail> xs:string </tail> [1]
<part> non-empty </part> [0..*]
</...>
Schema Component Representation
<xs:complexType name="meta">
<xs:sequence>
<xs:element name="head">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-z]+[a-z0-9]*"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="tail" type="xs:string"/>
<xs:element name="part" type="non-empty" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="line" type="whole"/>
</xs:complexType>
top

Complex Type: o

Super-types: None
Sub-types: None
Name o
Abstract no
Documentation The element contains all necessary details about a single object, including all its attributes (which are also objects). The object may also contain data, as text.
Application Data An object, as it is seen in the EO program
XML Instance Representation
<...
line="whole [0..1] ?"
pos="whole [0..1] ?"
name="attribute-name [0..1] ?"
base="fqn [0..1] ?"
ref="whole [0..1] ?"
as="attribute-name [0..1]"
atom="fqn [0..1]"
loc="locator [0..1]">
<!-- Mixed content -->
<o> ... </o> [0..*]
</...>
Schema Component Representation
<xs:complexType name="o" mixed="true">
<xs:sequence>
<xs:element name="o" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="line" type="whole"/>
<xs:attribute name="pos" type="whole"/>
<xs:attribute name="name" type="attribute-name"/>
<xs:attribute name="base" type="fqn"/>
<xs:attribute name="ref" type="whole"/>
<xs:attribute name="as" type="attribute-name"/>
<xs:attribute name="atom" type="fqn"/>
<xs:attribute name="loc" type="locator"/>
</xs:complexType>
top

Complex Type: program

Super-types: None
Sub-types: None
Name program
Abstract no
XML Instance Representation
<...
name="fqn [1] ?"
ms="whole [0..1] ?"
time="xs:dateTime [0..1] ?"
version="non-empty [0..1] ?"
revision="xs:string (pattern = [0-9a-f]{7}) [0..1] ?"
dob="xs:dateTime [0..1] ?"
source="non-empty [0..1] ?">
Start All [1]
<listing> listing </listing> [0..1]
<comments> [0..1] ?
<comment> comment </comment> [1..*]
</comments>
<errors> [0..1] ?
<error> error </error> [1..*]
</errors>
<sheets> [0..1] ?
<sheet> sheet </sheet> [1..*]
</sheets>
<license> license </license> [0..1]
<metas> [0..1]
<meta> meta </meta> [1..*]
</metas>
<objects> [1]
<o> o </o> [0..*]
</objects>
End All
</...>
Schema Component Representation
<xs:complexType name="program">
<xs:all>
<xs:element name="listing" type="listing" minOccurs="0"/>
<xs:element name="comments" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="comment" type="comment" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="errors" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="error" type="error" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sheets" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="sheet" type="sheet" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="license" type="license" minOccurs="0"/>
<xs:element name="metas" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="meta" type="meta" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="objects">
<xs:complexType>
<xs:sequence>
<xs:element name="o" type="o" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="name" type="fqn" use="required"/>
<xs:attribute name="ms" type="whole"/>
<xs:attribute name="time" type="xs:dateTime"/>
<xs:attribute name="version" type="non-empty"/>
<xs:attribute name="revision">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-f]{7}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="dob" type="xs:dateTime"/>
<xs:attribute name="source" type="non-empty"/>
</xs:complexType>
top

Simple Type: attribute-name

Super-types: xs:string < attribute-name (by restriction)
Sub-types: None
Name attribute-name
Content
  • Base XSD Type: string
  • pattern = α[0-9]+|@|[a-z]\S*
Documentation The name of an object attribute, which is used to reference the attribute from other objects or from the global scope.
Application Data A name of object attribute
Schema Component Representation
<xs:simpleType name="attribute-name">
<xs:restriction base="xs:string">
<xs:pattern value="α[0-9]+|@|[a-z]\S*"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: empty

Super-types: xs:string < empty (by restriction)
Sub-types: None
Name empty
Content
  • Base XSD Type: string
  • length = 0
Documentation Empty string, to be used in attributes.
Application Data Just empty string
Schema Component Representation
<xs:simpleType name="empty">
<xs:restriction base="xs:string">
<xs:length value="0"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: fqn

Super-types: xs:string < fqn (by restriction)
Sub-types: None
Name fqn
Content
  • Base XSD Type: string
  • pattern = ∅|Q|QQ|[A-Z]\S*|\.?(^|$|@|[a-z]\S*)|[a-z]\S*(\.[a-z]\S*)*
Documentation The fully qualified name of an object, which includes the names of all the objects that are its ancestors. This type is used to uniquely identify an object within the program. The FQN is typically used to reference objects from other objects or from the global scope, ensuring that the correct object is accessed or modified.
Application Data A fully qualified name of an object
Schema Component Representation
<xs:simpleType name="fqn">
<xs:restriction base="xs:string">
<xs:pattern value="∅|Q|QQ|[A-Z]\S*|\.?(^|$|@|[a-z]\S*)|[a-z]\S*(\.[a-z]\S*)*"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: locator

Super-types: xs:string < locator (by restriction)
Sub-types: None
Name locator
Content
  • Base XSD Type: string
  • pattern = Φ(\.(ρ|φ|α[0-9]+|[a-z]\S*))*
Documentation The locator of an object, which specifies the location of the object within the program, in the global graph of objects, starting from Φ. The locator is used to uniquely identify an object within the program and is typically used to reference objects from other objects or from the global scope, ensuring that the correct object is accessed or modified.
Application Data A locator of an object
Schema Component Representation
<xs:simpleType name="locator">
<xs:restriction base="xs:string">
<xs:pattern value="Φ(\.(ρ|φ|α[0-9]+|[a-z]\S*))*"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: non-empty

Super-types: xs:string < non-empty (by restriction)
Sub-types:
Name non-empty
Content
  • Base XSD Type: string
  • length >= 1
Documentation The value that is not empty (contains at least one character). This type is used for names, etc.
Application Data A non-empty string
Schema Component Representation
<xs:simpleType name="non-empty">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: sheet

Super-types: xs:string < sheet (by restriction)
Sub-types: None
Name sheet
Content
  • Base XSD Type: string
  • pattern = [a-z][a-z-]*
Documentation The element contains information about the XSL stylesheet that was applied to the XMIR during its optimization and/or transformation. This information is crucial for understanding the changes made to the XMIR document during these processes. The XSL stylesheet can include various transformations that optimize the structure, improve performance, or adapt the document for different purposes. By documenting the applied stylesheet, developers can trace back the modifications and ensure the integrity and correctness of the XMIR document.
Application Data The XSL stylesheet that was applied to the XMIR
Schema Component Representation
<xs:simpleType name="sheet">
<xs:restriction base="xs:string">
<xs:pattern value="[a-z][a-z-]*"/>
</xs:restriction>
</xs:simpleType>
top

Simple Type: whole

Super-types: xs:integer < whole (by restriction)
Sub-types: None
Name whole
Content
  • Base XSD Type: integer
  • value >= 0
Documentation Whole numbers, include zero. This type is used for line numbers, positions, etc.
Application Data Whole number
Schema Component Representation
<xs:simpleType name="whole">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
top

Legend

Complex Type:

Schema Component Type

AusAddress

Schema Component Name
Super-types: Address < AusAddress (by extension)
Sub-types:
  • QLDAddress (by restriction)
If this schema component is a type definition, its type hierarchy is shown in a gray-bordered box.
Name AusAddress
Abstract no
The table above displays the properties of this schema component.
XML Instance Representation
<... country="Australia">
<unitNo> string </unitNo> [0..1]
<houseNo> string </houseNo> [1]
<street> string </street> [1]
Start Choice[1]
<city> string </city> [1]
<town> string </town> [1]
End Choice
<state> AusStates </state> [1]
<postcode> string <<pattern = [1-9][0-9]{3}>> </postcode> [1]?
</...>

The XML Instance Representation table above shows the schema component's content as an XML instance.

Schema Component Representation
<complexTypename="AusAddress">
<complexContent>
<extensionbase="Address">
<sequence>
<elementname="state" type="AusStates"/>
<elementname="postcode">
<simpleType>
<restrictionbase="string">
<patternvalue="[1-9][0-9]{3}"/>
</restriction>
</simpleType>
</element>
</sequence>
<attributename="country" type="string" fixed="Australia"/>
</extension>
</complexContent>
</complexType>
The Schema Component Representation table above displays the underlying XML representation of the schema component. (Annotations are not shown.)
top

Glossary

Abstract (Applies to complex type definitions and element declarations). An abstract element or complex type cannot used to validate an element instance. If there is a reference to an abstract element, only element declarations that can substitute the abstract element can be used to validate the instance. For references to abstract type definitions, only derived types can be used.

All Model Group Child elements can be provided in any order in instances. See: http://www.w3.org/TR/xmlschema-1/#element-all.

Choice Model Group Only one from the list of child elements and model groups can be provided in instances. See: http://www.w3.org/TR/xmlschema-1/#element-choice.

Collapse Whitespace Policy Replace tab, line feed, and carriage return characters with space character (Unicode character 32). Then, collapse contiguous sequences of space characters into single space character, and remove leading and trailing space characters.

Disallowed Substitutions (Applies to element declarations). If substitution is specified, then substitution group members cannot be used in place of the given element declaration to validate element instances. If derivation methods, e.g. extension, restriction, are specified, then the given element declaration will not validate element instances that have types derived from the element declaration's type using the specified derivation methods. Normally, element instances can override their declaration's type by specifying an xsi:type attribute.

Key Constraint Like Uniqueness Constraint, but additionally requires that the specified value(s) must be provided. See: http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions.

Key Reference Constraint Ensures that the specified value(s) must match value(s) from a Key Constraint or Uniqueness Constraint. See: http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions.

Model Group Groups together element content, specifying the order in which the element content can occur and the number of times the group of element content may be repeated. See: http://www.w3.org/TR/xmlschema-1/#Model_Groups.

Nillable (Applies to element declarations). If an element declaration is nillable, instances can use the xsi:nil attribute. The xsi:nil attribute is the boolean attribute, nil, from the http://www.w3.org/2001/XMLSchema-instance namespace. If an element instance has an xsi:nil attribute set to true, it can be left empty, even though its element declaration may have required content.

Notation A notation is used to identify the format of a piece of data. Values of elements and attributes that are of type, NOTATION, must come from the names of declared notations. See: http://www.w3.org/TR/xmlschema-1/#cNotation_Declarations.

Preserve Whitespace Policy Preserve whitespaces exactly as they appear in instances.

Prohibited Derivations (Applies to type definitions). Derivation methods that cannot be used to create sub-types from a given type definition.

Prohibited Substitutions (Applies to complex type definitions). Prevents sub-types that have been derived using the specified derivation methods from validating element instances in place of the given type definition.

Replace Whitespace Policy Replace tab, line feed, and carriage return characters with space character (Unicode character 32).

Sequence Model Group Child elements and model groups must be provided in the specified order in instances. See: http://www.w3.org/TR/xmlschema-1/#element-sequence.

Substitution Group Elements that are members of a substitution group can be used wherever the head element of the substitution group is referenced.

Substitution Group Exclusions (Applies to element declarations). Prohibits element declarations from nominating themselves as being able to substitute a given element declaration, if they have types that are derived from the original element's type using the specified derivation methods.

Target Namespace The target namespace identifies the namespace that components in this schema belongs to. If no target namespace is provided, then the schema components do not belong to any namespace.

Uniqueness Constraint Ensures uniqueness of an element/attribute value, or a combination of values, within a specified scope. See: http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions.

top