Task 428: .MSDL File Format
Task 428: .MSDL File Format
File Format Specifications for .MSDL
The .MSDL file format refers to the Military Scenario Definition Language (MSDL), an XML-based format designed for describing military scenarios in modeling and simulation environments. It is defined by the SISO-STD-007-2008 standard from the Simulation Interoperability Standards Organization (SISO). The format uses XML to structure data, allowing for validation against its schema. MSDL files are typically saved with .xml extension, though referred to as MSDL files in documentation. The schema includes namespaces like msdl and jc3iedm, and supports elements for scenario metadata, environment, forces, organizations, and graphics. It enables interoperability between simulations and C4I systems.
- List of all the properties of this file format intrinsic to its file system.
The properties are the XML elements and their sub-elements/attributes, which define the structure. The root is <MilitaryScenario>. Key properties (elements) include:
ScenarioID: Metadata for identification.
- name
- type
- version
- modificationDate
- securityClassification
- releaseRestriction
- purpose
- applicationDomain
- description
- useLimitation
- useHistory
- keyword (with taxonomy and keywordValue)
- poc (with pocType, pocName, pocOrg, pocTelephone, pocEmail)
- reference (with type and identification)
- other
- glyph (with type, height, width, alt)
Options: Global parameters.
- MSDLVersion
- OrganizationDetail (with AggregateBased, AggregateEchelon)
- ScenarioDataStandards (with SymbologyDataStandard [StandardName, MajorVersion, MinorVersion], CoordinateDataStandard [CoordinateSystemType, CoordinateSystemDatum])
Environment: Environmental conditions.
- ScenarioTime
- AreaOfInterest (with Name, UpperRight, LowerLeft [both CoordinatesType with CoordinateChoice, CoordinateData])
- ScenarioWeather (with Atmosphere [HumidityRatio, InversionLayerCode, PressureQuantity, Temperature, TemperatureGradientCode], CloudCoverItems, Icing, LightItems, Precipitation, VisibilityItems, WindItems)
- METOC (with METOCGraphic [ObjectHandle, SymbolIdentifier, UniqueDesignation, DateTimeGroup, DateTimeGroup1, Quantity, AdditionalInfo, Disposition])
ForceSides: Force structures.
- ForceSide (with ObjectHandle, ForceSideName, AllegianceHandle, MilitaryService, CountryCode, Associations [AffiliateHandle, Relationship])
Organizations: Units and equipment.
- Units (with Unit [ObjectHandle, SymbolIdentifier, Name, UnitSymbolModifiers, CommunicationNetInstances, Status, Disposition, Relations, Model])
- Equipment (with Equipment [ObjectHandle, SymbolIdentifier, Name, EquipmentSymbolModifiers, CommunicationNetReferences, Status, Disposition, Relations, Model])
Overlays: Logical groupings.
- Overlay (with OverlayType)
Installations: Installations.
- Installation (with ObjectHandle, SymbolIdentifier, Name, InstallationSymbolModifiers, AssociatedOverlays, Disposition)
TacticalGraphics: Tactical information.
- TacticalGraphic (with ObjectHandle, SymbolIdentifier, Affiliation, Owner, SymbolClass, UniqueDesignation, DateTimeGroup, DateTimeGroup1, Quantity, AdditionalInfo, AdditionalInfo1, AdditionalInfo2, Echelon, ReinforcedReduced, StaffComments, CombatEffectiveness, HigherFormation, IFF, SpecialC2HQ, DirectionOfMovement, Speed, Orientation, NBCType, FrameShapeModifier, Disposition)
MOOTWGraphics: Military Operations Other Than War graphics.
- MOOTWGraphic (with ObjectHandle, SymbolIdentifier, Affiliation, Owner, UniqueDesignation, DateTimeGroup, DateTimeGroup1, Quantity, AdditionalInfo, Echelon, ReinforcedReduced, FrameShapeModifier, StaffComments, CombatEffectiveness, IFF, SpecialC2HQ, AssociatedOverlays, Disposition)
Intrinsic features include UUID for identification, enumerations for constrained values (e.g., enumEchelon, enumBaseAffiliation), patterns for formats (e.g., patternUUID32, patternTimeDTG20), and JC3IEDM-derived types for meteorological data.
- Two direct download links for files of format .MSDL.
Unable to find public direct download links for .MSDL files during my search. The format is XML-based, and while the specification references example structures, no publicly available .msdl or .xml example files were located. You may need to contact SISO or check restricted repositories for samples.
- Ghost blog embedded HTML JavaScript for drag and drop to dump properties.
Here is an HTML page with embedded JavaScript that allows dragging and dropping an MSDL (XML) file. It parses the file and dumps all the properties (elements and their values) to the screen.
- Python class for opening, decoding, reading, writing, and printing properties.
import xml.etree.ElementTree as ET
import os
class MSDLHandler:
def __init__(self, filepath):
self.filepath = filepath
self.tree = None
self.root = None
def read(self):
if not os.path.exists(self.filepath):
raise FileNotFoundError(f"File {self.filepath} not found.")
self.tree = ET.parse(self.filepath)
self.root = self.tree.getroot()
def print_properties(self):
if not self.root:
print("No file loaded. Call read() first.")
return
self._print_element(self.root)
def _print_element(self, element, indent=""):
print(f"{indent}{element.tag}: {element.text.strip() if element.text else ''}")
for key, value in element.attrib.items():
print(f"{indent} @{key}: {value}")
for child in element:
self._print_element(child, indent + " ")
def write(self, new_filepath):
if not self.tree:
print("No file loaded. Call read() first.")
return
self.tree.write(new_filepath, encoding='utf-8', xml_declaration=True)
print(f"File written to {new_filepath}")
# Example usage
# handler = MSDLHandler('example.msdl')
# handler.read()
# handler.print_properties()
# handler.write('output.msdl')
- Java class for opening, decoding, reading, writing, and printing properties.
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.io.File;
public class MSDLHandler {
private String filepath;
private Document doc;
public MSDLHandler(String filepath) {
this.filepath = filepath;
this.doc = null;
}
public void read() throws Exception {
File file = new File(filepath);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
this.doc = dBuilder.parse(file);
this.doc.getDocumentElement().normalize();
}
public void printProperties() {
if (doc == null) {
System.out.println("No file loaded. Call read() first.");
return;
}
printElement(doc.getDocumentElement(), "");
}
private void printElement(Node node, String indent) {
System.out.print(indent + node.getNodeName() + ": ");
if (node.getNodeValue() != null) {
System.out.print(node.getNodeValue().trim());
}
System.out.println();
NamedNodeMap attrs = node.getAttributes();
if (attrs != null) {
for (int i = 0; i < attrs.getLength(); i++) {
Node attr = attrs.item(i);
System.out.println(indent + " @" + attr.getNodeName() + ": " + attr.getNodeValue());
}
}
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
printElement(children.item(i), indent + " ");
}
}
}
public void write(String newFilepath) throws Exception {
if (doc == null) {
System.out.println("No file loaded. Call read() first.");
return;
}
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(new File(newFilepath));
transformer.transform(source, result);
System.out.println("File written to " + newFilepath);
}
// Example usage
// public static void main(String[] args) throws Exception {
// MSDLHandler handler = new MSDLHandler("example.msdl");
// handler.read();
// handler.printProperties();
// handler.write("output.msdl");
// }
}
- JavaScript class for opening, decoding, reading, writing, and printing properties.
Note: For "opening" in JS, we use FileReader for browser or fs for Node. This is for Node.js.
const fs = require('fs');
const { DOMParser, XMLSerializer } = require('xmldom');
class MSDLHandler {
constructor(filepath) {
this.filepath = filepath;
this.doc = null;
}
read() {
const xmlText = fs.readFileSync(this.filepath, 'utf8');
const parser = new DOMParser();
this.doc = parser.parseFromString(xmlText);
}
printProperties() {
if (!this.doc) {
console.log('No file loaded. Call read() first.');
return;
}
this._printElement(this.doc.documentElement, '');
}
_printElement(node, indent) {
let text = indent + node.nodeName + ': ';
if (node.textContent && node.textContent.trim()) {
text += node.textContent.trim();
}
console.log(text);
for (let i = 0; i < node.attributes.length; i++) {
const attr = node.attributes[i];
console.log(`${indent} @${attr.name}: ${attr.value}`);
}
for (let child = node.firstChild; child; child = child.nextSibling) {
if (child.nodeType === 1) { // Element node
this._printElement(child, indent + ' ');
}
}
}
write(newFilepath) {
if (!this.doc) {
console.log('No file loaded. Call read() first.');
return;
}
const serializer = new XMLSerializer();
const xmlStr = serializer.serializeToString(this.doc);
fs.writeFileSync(newFilepath, xmlStr);
console.log(`File written to ${newFilepath}`);
}
}
// Example usage
// const handler = new MSDLHandler('example.msdl');
// handler.read();
// handler.printProperties();
// handler.write('output.msdl');
- C class for opening, decoding, reading, writing, and printing properties.
Note: C does not have built-in XML parsing, so this uses a simple approach assuming a library like tinyxml2 is available (not included). For purity, a basic string-based parser is sketched, but full XML parsing in pure C is complex. Assume tinyxml2 is linked.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Assume tinyxml2.h is included and library linked
#include "tinyxml2.h"
class MSDLHandler {
private:
const char* filepath;
tinyxml2::XMLDocument doc;
public:
MSDLHandler(const char* fp) : filepath(fp) {}
bool read() {
if (doc.LoadFile(filepath) != tinyxml2::XML_SUCCESS) {
printf("Failed to load file %s\n", filepath);
return false;
}
return true;
}
void printProperties() {
tinyxml2::XMLElement* root = doc.FirstChildElement();
if (!root) {
printf("No file loaded or invalid XML.\n");
return;
}
printElement(root, "");
}
void printElement(tinyxml2::XMLElement* elem, const char* indent) {
printf("%s%s: %s\n", indent, elem->Name(), elem->GetText() ? elem->GetText() : "");
for (const tinyxml2::XMLAttribute* attr = elem->FirstAttribute(); attr; attr = attr->Next()) {
printf("%s @%s: %s\n", indent, attr->Name(), attr->Value());
}
for (tinyxml2::XMLElement* child = elem->FirstChildElement(); child; child = child->NextSiblingElement()) {
char newIndent[256];
snprintf(newIndent, sizeof(newIndent), "%s ", indent);
printElement(child, newIndent);
}
}
bool write(const char* newFilepath) {
if (doc.SaveFile(newFilepath) != tinyxml2::XML_SUCCESS) {
printf("Failed to write file %s\n", newFilepath);
return false;
}
printf("File written to %s\n", newFilepath);
return true;
}
};
// Example usage
// int main() {
// MSDLHandler handler("example.msdl");
// if (handler.read()) {
// handler.printProperties();
// handler.write("output.msdl");
// }
// return 0;
// }