Vc{ cs:dZddlZdddZiZdZdZd d Zd ZdS) zRegistration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.Nzxml.dom.minidomzxml.dom.DOMImplementation)ZminidomZ4DOMcs|t|<dS)aIregisterDOMImplementation(name, factory) Register the factory function with the name. The factory function should return an object which implements the DOMImplementation interface. The factory function can either return the same object, or a new one (e.g. if that implementation supports some customization).N) registered)nameZfactorys '/usr/lib64/python3.11/xml/dom/domreg.pyregisterDOMImplementationrsJtcsH|D]\}}|||sdSdS)zF_good_enough(dom, features) -> Return 1 if the dom offers the featuresr)Z hasFeature)domfeaturesZfvs r _good_enoughr s<!~~a"" 11  1rcsddl}d}t|}|r't|iidg}|S|rt |St jjs$d|j vrt |j dSt|trt|}t D] }|}t||r|cS!tD]8} t |}n#t $rY wxYwt||r|cS9t#d)aSgetDOMImplementation(name = None, features = ()) -> DOM implementation. Return a suitable DOM implementation. The name is either well-known, the module name of a DOM implementation, or None. If it is not None, imports the corresponding module and returns DOMImplementation object if the import succeeds. If name is not given, consider the available implementations to find one with the required feature set. If no implementation can be found, raise an ImportError. The features list must be a sequence of (feature, version) pairs which are passed to hasFeature.rNgetDOMImplementationZ PYTHON_DOM)rz$no suitable DOM implementation found)oswell_known_implementationsZgetZ __import__r rsysZflagsZignore_environmentZenvironZ isinstanceZstr_parse_feature_stringZvaluesr ZkeysZ ExceptionZ ImportError)rrr ZcreatorZmodrs rr r 'sIIIG $ ( ( . .C Eb"'=&>??''))) E$!!! Y )Elbj.HE#2:l+CDDDD(C  3(22$$&&gii X & & JJJ .2244 &g666CC    H  X & & JJJ  < = ==sD  D-,D-csHg}|}d}t|}||krg||}|ddvrtd||dz}d}||kr||}|ddvr|dz}|}|||f||kgt |S)NrZ 0123456789zbad feature name: r)ZsplitZlenZ ValueErrorZappendZtuple)ZsrZpartsZiZlengthZfeatureZversionr s rrrRsH GGIIE A ZZF f* ,( 1: % B*ww@AA A E v: aAt|# E'*+++ f* , ??r)Nr )Z__doc__rrrrr r rr rrrs>>  '       )>)>)>)>Vr