cyclonedx.validation.xml
Classes
Validation failed with this specific error. |
|
Validator for CycloneDX documents in XML format. |
Module Contents
- class cyclonedx.validation.xml.XmlValidationError(data: Any)
Bases:
cyclonedx.validation.ValidationErrorValidation failed with this specific error.
Use
datato access the content.- data: Any
Raw error data from one of the underlying validation methods.
- class cyclonedx.validation.xml.XmlValidator(schema_version: cyclonedx.schema.SchemaVersion)
Bases:
_BaseXmlValidator,cyclonedx.validation.BaseSchemabasedValidator,cyclonedx.validation.SchemabasedValidatorValidator for CycloneDX documents in XML format.
- property output_format: Literal[cyclonedx.schema.OutputFormat.XML]
Get the format.
- validate_str(data: str, *, all_errors: Literal[False] = ...) XmlValidationError | None
- validate_str(data: str, *, all_errors: Literal[True]) collections.abc.Iterable[XmlValidationError] | None
Validate a string
- Parameters:
data – the data string to validate
all_errors – whether to return all errors or only (any)one - if any
- Returns:
validation error
- Retval None:
if
datais valid- Retval ValidationError:
if
datais invalid andall_errorsisFalse- Retval Iterable[ValidationError]:
if
datais invalid andall_errorsisTrue
- property schema_version: cyclonedx.schema.SchemaVersion
Get the schema version.