This commit is contained in:
parent
268aad56c8
commit
0dc59cea16
@ -25,7 +25,7 @@ use std::{
|
|||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
use log::info;
|
use log::{info};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
law::LawBuilder,
|
law::LawBuilder,
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::iter::Peekable;
|
use std::iter::Peekable;
|
||||||
|
|
||||||
|
use log::trace;
|
||||||
use roxmltree::{Children, Node};
|
use roxmltree::{Children, Node};
|
||||||
|
|
||||||
use crate::law::LawBuilder;
|
use crate::law::LawBuilder;
|
||||||
@ -102,6 +103,7 @@ impl Abschnitt {
|
|||||||
|
|
||||||
// We are done with meta-data parsing
|
// We are done with meta-data parsing
|
||||||
if key == "Text" {
|
if key == "Text" {
|
||||||
|
trace!("Done parsing metadata, got 'Text'");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,6 +127,7 @@ impl Abschnitt {
|
|||||||
builder.add_next_para_note(value.clone());
|
builder.add_next_para_note(value.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trace!("Parsed metadata: key='{key}', value='{value}'");
|
||||||
self.metadata.insert(key, value);
|
self.metadata.insert(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
use std::iter::Peekable;
|
use std::iter::Peekable;
|
||||||
|
|
||||||
|
use log::trace;
|
||||||
use roxmltree::{Children, Node};
|
use roxmltree::{Children, Node};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -33,6 +34,7 @@ impl Liste {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn parse_full(n: &mut Peekable<Children>) -> Self {
|
pub(crate) fn parse_full(n: &mut Peekable<Children>) -> Self {
|
||||||
|
trace!("Parsing liste...");
|
||||||
Expect::from(n.peek().unwrap()).tag("liste");
|
Expect::from(n.peek().unwrap()).tag("liste");
|
||||||
|
|
||||||
let mut content = Vec::new();
|
let mut content = Vec::new();
|
||||||
|
@ -77,6 +77,7 @@ impl Risdok {
|
|||||||
|
|
||||||
pub(crate) fn from_str(xml: &str, builder: &mut LawBuilder) -> Result<bool, Error> {
|
pub(crate) fn from_str(xml: &str, builder: &mut LawBuilder) -> Result<bool, Error> {
|
||||||
let doc = roxmltree::Document::parse(xml)?;
|
let doc = roxmltree::Document::parse(xml)?;
|
||||||
|
trace!("{doc:?}");
|
||||||
let root = doc.root();
|
let root = doc.root();
|
||||||
assert_eq!(root.children().count(), 1);
|
assert_eq!(root.children().count(), 1);
|
||||||
Ok(Self::parse(root.children().next().unwrap(), builder))
|
Ok(Self::parse(root.children().next().unwrap(), builder))
|
||||||
@ -171,6 +172,7 @@ impl Ziffernliste {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn parse(c: &mut Peekable<Children>) -> Self {
|
pub(crate) fn parse(c: &mut Peekable<Children>) -> Self {
|
||||||
|
trace!("Parsing Ziffernliste...");
|
||||||
let n = c.next().unwrap();
|
let n = c.next().unwrap();
|
||||||
|
|
||||||
assert!(Self::test(&n));
|
assert!(Self::test(&n));
|
||||||
|
Loading…
Reference in New Issue
Block a user