From 088a04a3dc6d4bba3c5210818e88606cd0a380dc Mon Sep 17 00:00:00 2001 From: Dmitry Pershin Date: Tue, 11 Mar 2025 22:40:34 +0500 Subject: [PATCH] fix: reserved namespaces registration skipped. --- pydantic_xml/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydantic_xml/utils.py b/pydantic_xml/utils.py index 0b137b3..0553e6a 100644 --- a/pydantic_xml/utils.py +++ b/pydantic_xml/utils.py @@ -81,7 +81,7 @@ def register_nsmap(nsmap: NsMap) -> None: """ for prefix, uri in nsmap.items(): - if prefix != '': # skip default namespace + if prefix != '' and not re.match(r"ns\d+$", prefix): # skip default namespace and reserved ones etree.register_namespace(prefix, uri)