Documentation Language: Swift

Class

XMIParser

Parser for XMI (XML Metadata Interchange) files

actor XMIParser

Overview

The XMI parser converts XMI files into EMF-compatible object graphs stored in Resources. It handles:

Cross-Resource References

When parsing an href attribute with an external URI (e.g., href="department-b.xmi#/"), the parser creates a ResourceProxy instead of resolving immediately. The proxy can be resolved later using ResourceProxy.resolve(in:), which will automatically load the target resource if needed.

Same-resource references (e.g., href="#//@employees.0") are resolved to EUUID values during the two-pass parsing process.

Supported XMI Features

Usage Example

let parser = XMIParser()
let resource = try await parser.parse(ecoreURL)
let roots = await resource.getRootObjects()

Topics

Initializers

?
init(resourceSet:enableDebugging:)

Initialises a new XMI parser.

Instance Methods

F
enableDebugging(_:)

Enable or disable debug mode for systematic tracing

F
parse(_:)

Parse an XMI file and return a Resource containing the objects

Default Implementations

Relationships

Conforms To

See Also

Resources and Serialisation

?
Resource

A resource manages model objects and provides EMF-compliant reference resolution.

?
ResourceSet

A resource set manages multiple resources and enables cross-resource reference resolution.

S
XMISerializer

Serialises EMF objects to XMI (XML Metadata Interchange) format

?
JSONParser

Parser for JSON files in emfjson/pyecore format

S
JSONSerializer

Serializes EMF objects to JSON format (emfjson/pyecore compatible)