src/core/XMLValidator.h

XMLValidator [Module]

Description

The XMLValidator module provides XML validation and error correction functionalities.

Functions

std::pair<bool, std::vector<Error>> verify(const std::string& content)
Verifies XML structure and returns validation status with any detected errors.
Parameters
  • content: Raw XML content string.
Returns
Pair of bool (isValid) and vector of Error structures.
std::pair<int, int> countErrorSummary(const std::string& content)
Counts total XML errors.
Returns
Pair of integers representing different error counts.
std::string fixXml(const std::string& content)
Attempts to auto-fix XML errors by correcting tag mismatches and structural issues.
Returns
Fixed XML string.
bool isClosingTag(const std::string& tag)
Checks if a tag string represents a closing tag.
Returns
true if the tag is a closing tag.