//! The main XML parser. use encoding::label::encoding_from_whatwg_label; use encoding::DecoderTrap; use libc; use markup5ever::{ expanded_name, local_name, namespace_url, ns, ExpandedName, LocalName, Namespace, QualName, }; use std::cell::RefCell; use std::collections::HashMap; use std::rc::{Rc, Weak}; use std::str; use crate::allowed_url::AllowedUrl; use crate::document::{Document, DocumentBuilder}; use crate::error::LoadingError; use crate::io::{self, get_input_stream_for_loading}; use crate::limits::MAX_LOADED_ELEMENTS; use crate::node::{NodeType, RsvgNode}; use crate::property_bag::PropertyBag; use crate::style::{Style, StyleType}; use crate::text::NodeChars; use crate::xml2_load::Xml2Parser; use crate::xml_rs::{reader::XmlEvent, ParserConfig}; #[derive(Clone)] enum Context { // Starting state Start, // Creating nodes for elements under the current node ElementCreation, // Inside