forked from stpaine/FERS
-
Notifications
You must be signed in to change notification settings - Fork 1
XML Scenario Loading
David Young edited this page Apr 30, 2025
·
1 revision
Loads the main simulation definition from a user-specified XML file, serving as the primary input configuration for a FERS simulation run.
- Assumes the provided filename points to an existing file that the application has permission to read.
- Assumes the file contains well-formed XML content that can be successfully parsed by the underlying
libxml2library.
-
Dependency on libxml2: The core XML parsing functionality relies entirely on the external
libxml2library. Consequently, error messages generated for malformed XML or file access issues during the initial read often originate directly fromlibxml2and may vary in user-friendliness or detail. - File-Based Input Only: This mechanism is designed specifically for loading simulation definitions from files located on the filesystem. There is no built-in support within this loading path for accepting XML definitions directly from other sources, such as network streams or in-memory string buffers.
-
xml_parser.cpp::parseSimulation(Higher-level function coordinating the overall XML parsing process) -
libxml_wrapper.cpp::XmlDocument::loadFile(Wrapper function directly invoking thelibxml2file reading functionality) -
libxml2library (External dependency performing the actual file reading and initial XML parsing) - XML Structure Parsing Utilities (Lower-level utilities for navigating the parsed XML)
- XML Modular Scenarios (Include) (This feature is processed after the initial file load)
- XML Validation (DTD-XSD) (Validation is typically performed after the initial file load and potential merging of includes)
- Needs Verification: While core loading of valid files is implicitly tested by any successful simulation run, the robustness of error handling for various failure conditions needs specific verification.
-
Key Areas for Validation:
- Behavior when the specified XML file does not exist.
- Behavior when the specified XML file exists but lacks read permissions.
- Behavior when the file exists but contains fundamentally malformed XML (e.g., mismatched tags, invalid characters) before FERS-specific structure or DTD/XSD validation occurs.
- Ensuring error messages are reasonably informative to the user (within the constraints imposed by
libxml2).
- Priority: Medium (Core functionality is essential, but robust error handling significantly impacts usability)