Fix dockerfile for xml schema validator
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
//! A streaming XML validator that checks XML fragments against an XSD schema
|
||||
|
||||
mod error;
|
||||
mod python;
|
||||
mod schema;
|
||||
mod token;
|
||||
|
||||
@@ -13,7 +14,7 @@ use token::*;
|
||||
/// An XML validator that checks XML fragments against an XSD schema
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct XmlValidator {
|
||||
current_tokens: Vec<std::rc::Rc<Token>>,
|
||||
current_tokens: Vec<Box<Token>>,
|
||||
}
|
||||
|
||||
/// The Result type used throughout this crate
|
||||
@@ -26,10 +27,9 @@ impl XmlValidator {
|
||||
pub fn new(schema_text: &str) -> Result<Self> {
|
||||
let schema: schema::XsSchema = quick_xml::de::from_str(schema_text)?;
|
||||
let current_tokens = schema.xs_element.iter().map(|element| {
|
||||
std::rc::Rc::new(Token::StartOfFile(StartOfFile::new(std::rc::Rc::new(element.clone()))))
|
||||
Box::new(Token::StartOfFile(StartOfFile::new(Box::new(element.clone()))))
|
||||
}).collect();
|
||||
|
||||
//let current_tokens = vec![std::rc::Rc::new(Token::StartOfFile(StartOfFile))];
|
||||
Ok(Self {
|
||||
current_tokens,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user