mirror of
https://github.com/Astatin3/IntroToWebAuthoring.git
synced 2026-06-09 00:28:00 -06:00
Add XML Parsing
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::views::View;
|
||||
|
||||
mod interpreter;
|
||||
mod parser;
|
||||
|
||||
pub const TEST_XML: &'static str = include_str!("../../pages/main.xml");
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Tag {
|
||||
name: String,
|
||||
children: Vec<Tag>,
|
||||
attributes: HashMap<String, String>,
|
||||
}
|
||||
|
||||
pub fn parse(xml: &str) -> Box<dyn View> {
|
||||
let tag = parser::parse_xml(xml);
|
||||
interpreter::interpret_tag(tag)
|
||||
}
|
||||
Reference in New Issue
Block a user