MCPcopy Index your code
hub / github.com/python/cpython / external_entity_ref_handler

Method external_entity_ref_handler

Lib/xml/dom/expatbuilder.py:685–705  ·  view source on GitHub ↗
(self, context, base, systemId, publicId)

Source from the content-addressed store, hash-verified

683 return ""
684
685 def external_entity_ref_handler(self, context, base, systemId, publicId):
686 if systemId == _FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID:
687 # this entref is the one that we made to put the subtree
688 # in; all of our given input is parsed in here.
689 old_document = self.document
690 old_cur_node = self.curNode
691 parser = self._parser.ExternalEntityParserCreate(context)
692 # put the real document back, parse into the fragment to return
693 self.document = self.originalDocument
694 self.fragment = self.document.createDocumentFragment()
695 self.curNode = self.fragment
696 try:
697 parser.Parse(self._source, True)
698 finally:
699 self.curNode = old_cur_node
700 self.document = old_document
701 self._source = None
702 return -1
703 else:
704 return ExpatBuilder.external_entity_ref_handler(
705 self, context, base, systemId, publicId)
706
707
708class Namespaces:

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected