|
@@ -4,6 +4,7 @@ use std::io::BufReader;
|
|
|
use xml::reader::{EventReader, XmlEvent};
|
|
|
use xml::writer::XmlEvent as WrXmlEvent;
|
|
|
use xml::EmitterConfig;
|
|
|
+use std::collections::HashMap;
|
|
|
|
|
|
use std::error::Error;
|
|
|
|
|
@@ -24,6 +25,15 @@ pub fn load_ksudoku(filename: std::path::PathBuf) -> Result<String, Box<dyn Erro
|
|
|
// <graph specific-type="Plain" type="sudoku" order="9"/>
|
|
|
// Verify these are correct / not some other puzzle type!
|
|
|
|
|
|
+ // This might be overkill here, I just need to verify Plain/sudoku/9...
|
|
|
+
|
|
|
+ let mut attrs: HashMap<String, String> = HashMap::new();
|
|
|
+ for a in attributes {
|
|
|
+ attrs.insert(a.name.to_string(), a.value);
|
|
|
+ }
|
|
|
+ // {"specific-type": "Plain", "type": "sudoku", "order": "9"}
|
|
|
+
|
|
|
+ println!("{:?}", attrs);
|
|
|
}
|
|
|
}
|
|
|
Ok(XmlEvent::Characters(text)) => {
|