From 239488b0b8387fd35e1fd032600b8d815c7e66e6 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 25 Jan 2025 17:15:46 +0100 Subject: [PATCH] namespace: ignore nested records In Gsk-4.0 the record Gsk.PathPoint contains a nested record. In case the tag didn't have a name we would just go up the tree until we found one. In case of a nested record this results in Gsk.PathPoint being found twice, the second time with the nested record which should be record. Fix by not going up for "record" which should never be needed there. --- pgidocgen/namespace.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pgidocgen/namespace.py b/pgidocgen/namespace.py index fabb318..6b87e2b 100644 --- a/pgidocgen/namespace.py +++ b/pgidocgen/namespace.py @@ -697,12 +697,18 @@ def get_name(elm): return n + # these can be nested, so if there is not name, don't go up the tree + # or we might up ending up with the same name as the parent record + requires_name = ["record"] + l = [] tags = [] current = e name = get_name(current) if name is not None: l.append(name) + elif current.tagName in requires_name: + continue shadowed = False while current.tagName != "namespace": # this gets shadowed by another entry, bail out