codemetropolis / CodeMetropolis

See your software as never before.
http://codemetropolis.github.io/CodeMetropolis/
14 stars 30 forks source link

Standardization and Validation of XML Formats with XSD for CDF and Mapping Files #346

Open SzatmariA opened 5 months ago

SzatmariA commented 5 months ago

The current definitions of both the CDF format and the mapping file format are embedded within the codebase, making it challenging for developers and tools to validate and comprehend the expected structure and constraints of these XML documents. Moving to a standardized XSD approach, similar to our use of IXML, will provide a clear, external schema for these formats, enhancing our toolchain's modularity and usability.

Proposed Enhancements: Create an XSD for the CDF File Format:

Develop an XSD that accurately represents the structure, elements, and attributes of the CDF XML format as currently implemented and used within the toolchain. Ensure that the XSD covers all aspects of the CDF format, including any implicit rules and constraints embedded in the current code-based definition. Create an XSD for the Mapping File Format:

Similarly, develop an XSD for the mapping file format, detailing the expected XML structure, elements, attributes, and constraints as defined in the toolchain's mapping component. This XSD should serve as a definitive guide to producing and consuming mapping XML files, ensuring consistency and validity across different uses. Integrate XSD Validation into the Mapping Tool:

Modify the mapping tool to perform XSD validation of both CDF and mapping XML files before proceeding with any processing steps. This validation step will ensure that only well-formed and schema-compliant XML files are processed, reducing errors and inconsistencies in later stages. Expected Outcomes: Two well-defined XSD files that serve as the authoritative schema for CDF and mapping XML formats. Enhanced validation mechanisms within the mapping tool, improving the robustness and reliability of processing steps. Easier integration with external tools and improved documentation and understanding of the XML formats used within the toolchain. Action Items: Draft the XSD for the CDF file format, based on the current code definitions and requirements. Draft the XSD for the mapping file format, ensuring it aligns with the toolchain's expectations and use cases. Update the mapping tool to include an XSD validation step for both CDF and mapping XML files before any processing. Document the new XSDs and validation process, providing guidance for developers and users on how to use and validate against these schemas.