On this page
pyexpat.XMLParserType
Prev: pyexpat.ParserCreate | Up: pyexpat
Rel: pyexpat.error, pyexpat.ErrorString, pyexpat.ExpatError, pyexpat.ParserCreate
Ref: docs.python.org — pyexpat.XMLParserType
Tags: #public #python3 #stdlib #pyexpat
Import
import pyexpat
from pyexpat import XMLParserType
Signature & Overview
pyexpat.XMLParserType()
XML parser
Methods & Attributes
XMLParserType.ExternalEntityParserCreate(...)— Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler.XMLParserType.GetBase(self, /)— Return base URL string for the parser.XMLParserType.GetInputContext(self, /)— Return the untranslated text of the input that caused the current event.XMLParserType.GetReparseDeferralEnabled(self, /)— Retrieve reparse deferral enabled status; always returns false with Expat <2.6.0.XMLParserType.Parse(self, data, isfinal=False, /)— Parse XML data.XMLParserType.ParseFile(self, file, /)— Parse XML data from file-like object.XMLParserType.SetAllocTrackerActivationThreshold(self, threshold, /)— Sets the number of allocated bytes of dynamic memory needed to activate protection against disproportionate use of RAM.XMLParserType.SetAllocTrackerMaximumAmplification(self, max_factor, /)— Sets the maximum amplification factor between direct input and bytes of dynamic memory allocated.XMLParserType.SetBase(self, base, /)— Set the base URL for the parser.XMLParserType.SetBillionLaughsAttackProtectionActivationThreshold(self, threshold, /)— Sets the number of output bytes needed to activate protection against billion laughs attacks.XMLParserType.SetBillionLaughsAttackProtectionMaximumAmplification(self, max_factor, /)— Sets the maximum tolerated amplification factor for protection against billion laughs attacks.XMLParserType.SetParamEntityParsing(self, flag, /)— Controls parsing of parameter entities (including the external DTD subset).XMLParserType.SetReparseDeferralEnabled(self, enabled, /)— Enable/Disable reparse deferral; enabled by default with Expat >=2.6.0.XMLParserType.UseForeignDTD(self, flag=True, /)— Allows the application to provide an artificial external subset if one is not specified as part of the document instance.
Usage
import pyexpat
assert isinstance(pyexpat.ParserCreate(), pyexpat.XMLParserType)
Gotchas
- Created only via
pyexpat.ParserCreate().
REPL Inspect
from pyexpat import XMLParserType
help(XMLParserType)
Linked from
Related notes
- tuts/python3/stdlib_module/pyexpat/error Linked here; links to this page; shared tags: #pyexpat, #stdlib
- tuts/python3/stdlib_module/pyexpat/ErrorString Linked here; links to this page; shared tags: #pyexpat, #stdlib
- tuts/python3/stdlib_module/pyexpat/ExpatError Linked here; links to this page; shared tags: #pyexpat, #stdlib
- tuts/python3/stdlib_module/pyexpat/ParserCreate Linked here; links to this page; shared tags: #pyexpat, #stdlib
- tuts/python3/stdlib_module/pyexpat Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib