xml

The xml module provides a Python interface for the XML 1.1 and XML Information Set specifications. This Python interface enables the user to navigate the XML document tree and access information from any XML node including post-schema-validation infoset properties as described in the XML Schema specification.

Enum Classes

class xml.AssignSchemaOrDTD

Defines how a schema/DTD is assigned to the generated document.

AssignSchemaOrDTD.ASSIGNABSOLUTELY

With absolute path.

AssignSchemaOrDTD.ASSIGNRELATIVELY

With relative path.

AssignSchemaOrDTD.DONOTASSIGN

Don’t assign schema/dtd.

class xml.ChoiceMode

Defines the branch to use if a choice is encountered.

ChoiceMode.ALLBRANCHES

All branches of choice

ChoiceMode.FIRSTBRANCH

First branch of choice

ChoiceMode.SHORTESTBRANCH

Branch with the smallest number of Elements

class xml.EnumValues

Defines how manually added sample values are used.

EnumValues.CYCLETHROUGH

Cycle through choices.

EnumValues.FIRSTFIT

Use first choice.

EnumValues.RANDOMFIT

Randomize enum choice.

class xml.ErrorSeverity

The xml.ErrorSeverity enumeration represents the severity of a single error object.

ErrorSeverity.ERROR

The error object represents an error.

ErrorSeverity.INCONSISTENCY

The error object represents an inconsistency error.

ErrorSeverity.INFO

The error object represents a piece of additional information.

ErrorSeverity.OTHER

The meaning of the error object should be derived from the current context.

ErrorSeverity.WARNING

The error object represents a warning.

class xml.SchemaSpecified

The xml.SchemaSpecified enumeration provides values for the post-schema-validation infoset properties xml.AttributeInformationItem.schema_specified and xml.ElementInformationItem.schema_specified.

SchemaSpecified.INFOSET

The schema normalized value of this element or attribute originates from the instance.

SchemaSpecified.NONE

Schema valditiy for the element or attribute wasn’t assessed.

SchemaSpecified.SCHEMA

The schema normalized value of this element or attribute originates from a value constraint (default value) in the schema.

class xml.ValidationAttempted

The xml.ValidationAttempted enumeration provides values for the post-schema-validation infoset properties xml.AttributeInformationItem.validation_attempted and xml.ElementInformationItem.validation_attempted.

ValidationAttempted.FULL

The xml.InformationItem and all its children and attributes were strictly assessed.

ValidationAttempted.NONE

Neither the xml.InformationItem nor any of its children or attributes were strictly assessed.

ValidationAttempted.PARTIAL

The xml.InformationItem or any of its children or attributes was strictly assessed, but not all.

class xml.Validity

The xml.Validity enumeration provides values for the post-schema-validation infoset properties xml.AttributeInformationItem.validity and xml.ElementInformationItem.validity.

Validity.INVALID

The xml.ElementInformationItem or xml.AttributeInformationItem was strictly assessed and it is invalid.

Validity.NOTKNOWN

Validity is not known. Most likely the xml.ElementInformationItem or xml.AttributeInformationItem was laxly assessed.

Validity.VALID

The xml.ElementInformationItem or xml.AttributeInformationItem was strictly assessed and it is valid.

String Constants

xml.NAMESPACE_XINCLUDE

http://www.w3.org/2001/XInclude

xml.NAMESPACE_XML

http://www.w3.org/XML/1998/namespace

xml.NAMESPACE_XMLNS

http://www.w3.org/2000/xmlns/