From 5edd95cf8e1ed5b8aab8102f6ef9b3a24a77c09c Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Mon, 12 May 2025 17:11:31 +0200
Subject: [PATCH 3/6] Fix element check

Upstream-Status: Submitted [https://github.com/itstool/itstool/pull/57]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 itstool.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/itstool.in b/itstool.in
index 052255e..4c39660 100755
--- a/itstool.in
+++ b/itstool.in
@@ -864,7 +864,6 @@ class Document (object):
                             newnode.tail = prevtext
                     i += 1
 
-
     def merge_translations(self, translations, language, node=None, strict=False):
         is_root = False
         if node is None:
@@ -1026,7 +1025,8 @@ class Document (object):
         if isinstance(node, etree._Entity):
             msg.add_entity_ref(node.name)
             return
-        if isinstance(node, XMLAttr):
+        # Only allow elements
+        if isinstance(node, XMLAttr) or not isinstance(node.tag, str):
             return
         if node.get('{' + NS_ITST + '}drop', 'no') == 'yes':
             return
-- 
2.49.0

