Skip to main content

EntityResolver

Type Alias EntityResolver 

Source
pub type EntityResolver = Arc<dyn Fn(ExternalEntityRequest<'_>) -> Option<String> + Send + Sync>;
Expand description

A callback for resolving external entities.

Returns Some(replacement_text) to expand the entity, or None to reject the reference (which will produce a parse error or, in recovery mode, an empty expansion).

§Security

Warning: Enabling external entity resolution opens the door to XML External Entity (XXE) attacks. Only use this with trusted input, and consider restricting which URIs the resolver is willing to fetch.

Aliased Type§

pub struct EntityResolver { /* private fields */ }