astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- VOTable XML Handling (`astropy.io.votable`) »
- validate

# validate

astropy.io.votable.validate(source, output=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, xmllint=False, filename=None)

  Prints a validation report for the given file.

  Parameters:
    source python:path-like object or python:file-like object

      Path to a VOTABLE xml file or `Path` object having Path to a VOTABLE xml file. If file-like object, must be readable.

    output python:file-like object, optional

      Where to output the report. Defaults to `sys.stdout`. If `None`, the output will be returned as a string. Must be writable.

    xmllint bool, optional

      When `True`, also send the file to `xmllint` for schema and DTD validation. Requires that `xmllint` is installed. The default is `False`. `source` must be a file on the local filesystem in order for `xmllint` to work.

    filename `python:str`, optional

      A filename to use in the error messages. If not provided, one will be automatically determined from `source`.

  Returns:
    is_valid bool or `python:str`

      Returns `True` if no warnings were found. If `output` is `None`, the return value will be a string.