
    IR-e                          d Z ddlZddlZd ZdS )z
Functions to do XML schema and DTD validation.  At the moment, this
makes a subprocess call to xmllint.  This could use a Python-based
library at some point in the future, if something appropriate could be
found.
    Nc                    t           j                            |          \  }}|dk    rd}n|dk    rd}nt          d          t	          j        ddd||| gt          j        t          j        	          }|                                \  }}|j        d
k    rt          d          |j        dk     r(ddl
m} t          d ||j                    d          |j        ||fS )ay  
    Validates an XML file against a schema or DTD.

    Parameters
    ----------
    filename : str
        The path to the XML file to validate

    schema_file : str
        The path to the XML schema or DTD

    Returns
    -------
    returncode, stdout, stderr : int, str, str
        Returns the returncode from xmllint and the stdout and stderr
        as strings
    z.xsdz--schemaz.dtdz
--dtdvalidz2schema_file must be a path to an XML Schema or DTDxmllintz--nooutz--nonet)stdoutstderr   z-xmllint not found, so can not validate schemar   )signal_number_to_namez"xmllint was terminated by signal '')ospathsplitext	TypeError
subprocessPopenPIPEcommunicate
returncodeOSErrorastropy.utils.miscr   )	filenameschema_filebaseextschema_partpr   r   r   s	            :lib/python3.11/site-packages/astropy/utils/xml/validate.pyvalidate_schemar      s   $   --ID#
f}} 	"LMMM	Iy+{HM	 	 	A
 ]]__NFF|sEFFF	
		<<<<<<X1F1F}1U1UXXX
 
 	
 <''    )__doc__r
   r   r    r   r   <module>r       s?     
			    *( *( *( *( *(r   