src.preParseChecks package
Submodules
src.preParseChecks.preParseCheck module
- class BadEncodingCheck[source]
Bases:
PreParseCheck- run(input: bytes, validation_results: ValidationLogger) tuple[bool, bytes][source]
- class ByteOrderMarkCheck[source]
Bases:
PreParseCheckChecks for prohibited or wierd BOMs.
Could do this as part of the BadEncodingCheck, but that likely won’t deal with weird BOMs. Previous behaviour was to reencode if valid BOMs were found - we can now leave that to the BadEncodingCheck, but that means that there’s no point in running ByteOrderMarkCheck after BadEncodingCheck, because there won’t be anything to find.
Must be run before BadEncodingCheck to work.
- run(input: bytes, validation_results: ValidationLogger) tuple[bool, bytes][source]
- class NullByteCheck[source]
Bases:
PreParseCheck- run(input: bytes, validation_results: ValidationLogger) tuple[bool, bytes][source]
- class PreParseCheck[source]
Bases:
object- run(input: bytes, validation_results: ValidationLogger) tuple[bool, bytes][source]
src.preParseChecks.xmlStructureCheck module
- class XmlStructureCheck[source]
Bases:
PreParseCheckCheck for entity declarations and non-UTF-8 declared encodings.
This is a PreParseCheck because when we parse the XML using ElementTree later it processes all the declarations and replaces the entity references and there’s no way to stop that.
Only expat seems to allow the entity declarations to be observed, so using it directly even though the documentation says that doing so is deprecated (although it doesn’t offer an alternative!).
- run(input: bytes, validation_results: ValidationLogger) tuple[bool, bytes][source]