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

Method entity_decl_handler

Lib/xml/dom/expatbuilder.py:302–318  ·  view source on GitHub ↗
(self, entityName, is_parameter_entity, value,
                            base, systemId, publicId, notationName)

Source from the content-addressed store, hash-verified

300 _append_child(self.curNode, node)
301
302 def entity_decl_handler(self, entityName, is_parameter_entity, value,
303 base, systemId, publicId, notationName):
304 if is_parameter_entity:
305 # we don't care about parameter entities for the DOM
306 return
307 if not self._options.entities:
308 return
309 node = self.document._create_entity(entityName, publicId,
310 systemId, notationName)
311 if value is not None:
312 # internal entity
313 # node *should* be readonly, but we'll cheat
314 child = self.document.createTextNode(value)
315 node.childNodes.append(child)
316 self.document.doctype.entities._seq.append(node)
317 if self._filter and self._filter.acceptNode(node) == FILTER_REJECT:
318 del self.document.doctype.entities._seq[-1]
319
320 def notation_decl_handler(self, notationName, base, systemId, publicId):
321 node = self.document._create_notation(notationName, publicId, systemId)

Callers

nothing calls this directly

Calls 4

_create_entityMethod · 0.80
createTextNodeMethod · 0.80
appendMethod · 0.45
acceptNodeMethod · 0.45

Tested by

no test coverage detected