finish xml loader
@@ -28,13 +28,12 @@ impl Element {
}
-pub fn load_xml(mut file_content: &mut String) {
+pub fn load_xml(mut file_content: &mut String) -> Vec<Element> {
let mut parser = EventReader::from_str(file_content);
- parserFunc(parser);
-// parserFunc(parser.borrow());
+ return parserFunc(parser);
}
-fn parserFunc(parser: EventReader<&[u8]>) {
+fn parserFunc(parser: EventReader<&[u8]>) -> Vec<Element> {
let mut depth = 0;
let mut tempElement = &mut Element {
@@ -97,6 +96,7 @@ fn parserFunc(parser: EventReader<&[u8]>) {
}
println!("result>>>>>>> {}", fathers.len());
+ return fathers;
}
fn indent(size: usize) -> String {
