diff --git a/yaserde/tests/deserializer.rs b/yaserde/tests/deserializer.rs
index de218c6..fbdc88f 100644
--- a/yaserde/tests/deserializer.rs
+++ b/yaserde/tests/deserializer.rs
@@ -1117,3 +1117,20 @@ fn de_nested_macro_rules() {
float_attrs!(f32);
}
+
+#[test]
+fn de_strict() {
+ init();
+
+ #[derive(PartialEq, Debug, YaDeserialize)]
+ pub struct Struct {
+ id: i32,
+ }
+ let xml_content = r#"
+
+ 123
+
+ "#;
+ let load: Result = from_str(xml_content);
+ assert!(load.is_err());
+}
diff --git a/yaserde_derive/src/de/expand_struct.rs b/yaserde_derive/src/de/expand_struct.rs
index fca7486..90fddbe 100644
--- a/yaserde_derive/src/de/expand_struct.rs
+++ b/yaserde_derive/src/de/expand_struct.rs
@@ -431,6 +431,9 @@ pub fn parse(
match (namespace.as_str(), name.local_name.as_str()) {
#call_visitors
_ => {
+ ::yaserde::__derive_trace!("SKIPPINGSKIPPING Skipping element {:?}", name.local_name);
+ return Err(format!("Found unauthorized element {}", name.local_name));
+
let event = reader.next_event()?;
#write_unused