Parsing Messages
This package parses Orbit Data Messages provided as XML strings. All parsing functions accept either a raw XML AbstractString or an already-parsed XML.LazyNode object.
Parsing is strict and case-sensitive by default. Pass strict = false to parse_omm, parse_omms, or parse_odm to match XML tags and the required OMM id attribute value case-insensitively. Permissive mode also preserves an empty OMM header creation date as nothing, which accommodates known Celestrak OMM 2.0 output without inventing a timestamp. Such an incomplete message cannot be written as OMM 3.0. Both modes otherwise reject unrecognized tags and malformed or incomplete OMM sections.
Throughout this page, we assume the variable omm_xml holds the XML string of a single OMM, and ndm_xml holds a Navigation Data Message (NDM) that bundles two OMMs (AMAZONIA 1 and SCD 1).
Parsing a Single OMM
Use parse_omm to obtain a single OrbitMeanElementsMessage. If the input is an NDM containing several OMMs, only the first one is returned:
julia> omm = parse_omm(omm_xml)OrbitMeanElementsMessage: Header Comment : GENERATED VIA SPACE-TRACK.ORG API Creation Date : 2025-12-30T23:36:37 Originator : 18 SPCS Body └─ Segment ├─ Metadata │ Object Name : AMAZONIA 1 │ Object ID : 2021-015A │ Center Name : EARTH │ Ref. Frame : TEME │ Time System : UTC │ Mean Element Theory : SGP4 └─ Data └─ Mean Keplerian Elements Epoch : 2025-12-30T18:12:04.533984 Mean Motion : 14.40772474 rev/day Eccentricity : 0.0001124 Inclination : 98.3721° RA of Asc. Node : 75.0877° Arg. of Pericenter : 97.3772° Mean Anomaly : 262.7545°
If the input does not contain any OMM, the function returns nothing.
Parsing Multiple OMMs
When a document may contain several messages — as is typically the case with an NDM — use parse_omms to retrieve all OMMs as a vector:
julia> omms = parse_omms(ndm_xml)2-element Vector{OrbitMeanElementsMessage}: OMM: AMAZONIA 1 [2021-015A] (Epoch = 2025-12-30T18:12:04.533984) OMM: SCD 1 [1993-009B] (Epoch = 2025-12-30T20:30:29.736576)julia> length(omms)2julia> omms[2].body.segment.metadata.object_name"SCD 1"
parse_omms always returns a Vector{OrbitMeanElementsMessage}, which is empty when a recognized document contains no supported OMM.
Parsing Generic Orbit Data Messages
The parse_odm function is the most general entry point. It inspects the root tag of the document and dispatches to the appropriate parser:
parse_odm always returns a Vector{OrbitDataMessage}. A stand-alone <omm> produces a single-element vector, while an <ndm> produces a vector containing every supported message.
julia> odm = parse_odm(omm_xml)1-element Vector{OrbitDataMessage}: OMM: AMAZONIA 1 [2021-015A] (Epoch = 2025-12-30T18:12:04.533984)julia> odms = parse_odm(ndm_xml)2-element Vector{OrbitDataMessage}: OMM: AMAZONIA 1 [2021-015A] (Epoch = 2025-12-30T18:12:04.533984) OMM: SCD 1 [1993-009B] (Epoch = 2025-12-30T20:30:29.736576)
Only OMM messages are currently extracted. Other message types found inside an NDM (such as OPM, OEM, or OCM) are skipped with a warning, since they are not yet supported.
Working With LazyNode Directly
If you already have an XML.LazyNode — for instance, because you are traversing a larger document — you can pass it directly to any of the parsing functions:
using XML
xml = parse(omm_xml, LazyNode)
omm = parse_omm(xml)