Container and utility functions for global per-instance parsing state.

Constructor

new Docinfo(errorhandler, locator)

Parameters

Name Type Description
errorhandler Errorhandler
locator Locator

Name Description
attribute_current_values Holds `#CURRENT` attribute values.
backward_ids Contains already encountered normalized ID attribute values.
content_reference Attribute value of the top-most element (as of the most recent call to check_attribute_array()) with a declared value of #CONREF, if any.
current_rank_suffixes Maps rank groups (ie.
current_shortref_map Contains the name of a short reference map (of the base document type) as set by a short reference use declaration in document content.
effective_activated_link_processes Contains a comma-separated or singleton (or empty) list of link processes to activate in a template processing subcontext.
effective_link_attribute_declarations Buffers containing effective link attribute declarations, keyed by link process name.
effective_link_process_result_document_type_names Maps link set names to source document type names of the respective link process.
effective_link_process_source_document_type_names Maps link set names to source document type names of the respective link process.
effective_link_processing_declarations Buffers, keyed by link process name, containing link set declarations of LPDs active at the context position.
effective_markup_declarations Buffer to record markup declarations; parsed markup declarations will be appended here if record_effective_markup_declarations is enabled.
exclusion_exceptions Contains the space-separated list of exclusion exceptions holding at the context position.
most_recently_ended_element Holds element name most recently emitted to output (the element must recently popped off the output stack either as result of an end-element tag parsed from input or inferred by validator).

Name Description
check_idrefs_resolved Function to be called after all non-implied elements have been processed (eg.
reset Resets internal state.

Member Details

attribute_current_values :Object.<string, string>

Holds #CURRENT attribute values.

Entries in this map are keyed by (doctype_name, attribute_name) (ie. not including the element type name).

backward_ids :Object.<string, string>

Contains already encountered normalized ID attribute values.

check_idrefs_resolved()

Function to be called after all non-implied elements have been processed (eg. at the time of an end_document() event) to check if any IDREF/IDREFS did reference undeclared IDs.

Will cause a recoverable error if any IDREFs are unsatisfied.

content_reference :string

Attribute value of the top-most element (as of the most recent call to check_attribute_array()) with a declared value of #CONREF, if any.

Set by check_attribute_array when it is recognized that a #CONREF attribute is set; supposed to be only set when called for a parsed, not inferred element, and only on parsed rather than defaulted attributes.

Note that check_attribute_array() is called by Tokenizer after having emitted a start-element event to validator

Used by validator to check condition for implied-EMPTY ending rules on the event following the element where the #CONREF attribute occurred; see also comments on validator.is_governed_by_content_reference

Used by Tokenizer, on return from dispatch of a start-element tag, to block mixed content parsing (emitting whitespace as pcdata tokens to validator) when it would normally do based on the element's content model (which however is shadowed by the #CONREF atttribute)

Can't be used by linkhandler which has it's only logic to check a conref is present (ie. because it isn't set on the start-element event where the #CONREF attribute occurs)

current_rank_suffixes :Object.<string, string>

Maps rank groups (ie. space-separated strings containing elements as separated strings) to the current rank suffix active for the respective rank group.

Captured from a most recent (in document order) start- (or end-) element tag having a rank suffix specified for the group.

current_shortref_map :string

Contains the name of a short reference map (of the base document type) as set by a short reference use declaration in document content.

Also used/set when a current short reference map is determined by its associated element type (via short reference use declaration in a DTD).

Cleared whenever a start-element or end-element is emitted from tokenizer or validator.

Contains a comma-separated or singleton (or empty) list of link processes to activate in a template processing subcontext.

Buffers containing effective link attribute declarations, keyed by link process name.

Unlike effective_link_processing_declarations, link attribute declarations get populated at link process declaration parsing time, and linkhandlers are supposed to copy text from there over to effective_link_processing_declarations as first buffer portion upon regenerating state-dependent link set rules.

Maps link set names to source document type names of the respective link process.

Maps link set names to source document type names of the respective link process.

Buffers, keyed by link process name, containing link set declarations of LPDs active at the context position.

This includes an #INITIAL link set declaration reflecting the current link set of the respective LPD at the context position.

Buffers for LPDs are assumed to be populated/materialized by a link handler for the respective process stage when a data entity is encountered in upstream content (eg. as would be the event representing an upstream template application as seen from a downstream/subsequent link handler).

effective_markup_declarations :string

Buffer to record markup declarations; parsed markup declarations will be appended here if record_effective_markup_declarations is enabled.

Will be populated

  • with parameter entity declarations with resolved replacement text in place of external identifiers (including system-specific external identifiers)
  • without general entity declarations
  • with all other declaration except link set declarations recorded as-is from input (marked section won't get into here as these are already handled in Tokenizer)
exclusion_exceptions :string

Contains the space-separated list of exclusion exceptions holding at the context position.

Populated by validator on every start-element tag (only if performing validation, and disable_strict_template is false-y).

most_recently_ended_element :string

Holds element name most recently emitted to output (the element must recently popped off the output stack either as result of an end-element tag parsed from input or inferred by validator).

Used for handling FEATURES MINIMIZE OMITTAG STARTTAG YES.

reset()

Resets internal state.