cyclonedx.validation.xml
========================

.. py:module:: cyclonedx.validation.xml


Classes
-------

.. autoapisummary::

   cyclonedx.validation.xml.XmlValidationError
   cyclonedx.validation.xml.XmlValidator


Module Contents
---------------

.. py:class:: XmlValidationError(data: Any)

   Bases: :py:obj:`cyclonedx.validation.ValidationError`


   Validation failed with this specific error.

   Use :attr:`~data` to access the content.


   .. py:attribute:: data
      :type:  Any

      Raw error data from one of the underlying validation methods.



.. py:class:: XmlValidator(schema_version: cyclonedx.schema.SchemaVersion)

   Bases: :py:obj:`_BaseXmlValidator`, :py:obj:`cyclonedx.validation.BaseSchemabasedValidator`, :py:obj:`cyclonedx.validation.SchemabasedValidator`


   Validator for CycloneDX documents in XML format.


   .. py:property:: output_format
      :type: Literal[cyclonedx.schema.OutputFormat.XML]


      Get the format.



   .. py:method:: validate_str(data: str, *, all_errors: Literal[False] = ...) -> Optional[XmlValidationError]
                  validate_str(data: str, *, all_errors: Literal[True]) -> Optional[collections.abc.Iterable[XmlValidationError]]

      Validate a string

      :param data: the data string to validate
      :param all_errors: whether to return all errors or only (any)one - if any
      :return: validation error
      :retval None: if ``data`` is valid
      :retval ValidationError:  if ``data`` is invalid and ``all_errors`` is ``False``
      :retval Iterable[ValidationError]:  if ``data`` is invalid and ``all_errors`` is ``True``



   .. py:property:: schema_version
      :type: cyclonedx.schema.SchemaVersion


      Get the schema version.



