Fix dockerfile for xml schema validator

This commit is contained in:
2025-04-06 16:11:36 +02:00
parent 55a920414d
commit ea93adc4c8
21 changed files with 143 additions and 87 deletions

View File

@@ -3,12 +3,12 @@ use crate::*;
/// Represents the text content within an XML element
#[derive(Clone, Debug)]
pub struct TextContent {
element: std::rc::Rc<schema::XsElement>,
element: Box<schema::XsElement>,
buffer: String,
}
impl TextContent {
pub fn new(element: std::rc::Rc<schema::XsElement>) -> Self {
pub fn new(element: Box<schema::XsElement>) -> Self {
Self {
element,
buffer: String::new(),
@@ -16,19 +16,19 @@ impl TextContent {
}
/// Create a new TextContent with the given initial buffer
pub fn with_buffer(element: std::rc::Rc<schema::XsElement>, buffer: String) -> Self {
pub fn with_buffer(element: Box<schema::XsElement>, buffer: String) -> Self {
Self {
element,
buffer,
}
}
pub fn append(&self, c: char) -> Vec<std::rc::Rc<Token>> {
pub fn append(&self, c: char) -> Vec<Box<Token>> {
if c == '<' {
vec![std::rc::Rc::new(Token::ElementCloseStart(ElementCloseStart::new(self.element.clone())))]
vec![Box::new(Token::ElementCloseStart(ElementCloseStart::new(Box::new((*self.element).clone()))))]
} else {
vec![std::rc::Rc::new(Token::TextContent(TextContent::with_buffer(
self.element.clone(),
vec![Box::new(Token::TextContent(TextContent::with_buffer(
Box::new((*self.element).clone()),
self.buffer.clone() + &c.to_string(),
)))]
}