From c8ed16a2d1d1f1b5278936eeadeae87da7cb104e Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Tue, 19 Nov 2024 14:52:14 +0000 Subject: store only namespace name in qualified name, not namespace declaration --- src/element.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/element.rs') diff --git a/src/element.rs b/src/element.rs index 9bdde35..4c39c6a 100644 --- a/src/element.rs +++ b/src/element.rs @@ -10,7 +10,7 @@ use crate::{ // when are namespaces names chosen then if they are automatically calculated // namespaces are held by readers and writers. #[derive(PartialEq, Eq, Hash, Clone, Debug)] -pub struct Namespace { +pub struct NamespaceDeclaration { pub prefix: Option, pub namespace: String, } @@ -18,7 +18,7 @@ pub struct Namespace { // names are qualified, they contain a reference to the namespace (held within the reader/writer) #[derive(PartialEq, Eq, Hash, Clone, Debug)] pub struct Name { - pub namespace: Namespace, + pub namespace: String, pub name: String, } @@ -40,7 +40,7 @@ pub struct Element { // namespace: String, // hashmap of explicit namespace declarations on the element itself only // possibly not needed as can be calculated at write time depending on context and qualified namespace, and for reading, element validity and namespaces are kept track of by the reader. - pub namespace_decl: HashSet, + // pub namespace_decl: HashSet, // attributes can be in a different namespace than the element. how to make sure they are valid? // maybe include the namespace instead of or with the prefix // you can calculate the prefix from the namespaced name and the current writer context -- cgit