Skip to content

Commit c6da202

Browse files
committed
Add missing SPIRIT namespace URI variant for importer
1 parent 56188fd commit c6da202

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/peakrdl_ipxact/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.4.0"
1+
__version__ = "3.4.1"

src/peakrdl_ipxact/importer.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212

1313

1414
# Expected IP-XACT namespaces. This parser is not strict about the exact version.
15-
IPXACT_NAMESPACE_PREFIX = "http://www.accellera.org/XMLSchema/IPXACT/"
16-
SPIRIT_NAMESPACE_PREFIX = "http://www.spiritconsortium.org/XMLSchema/SPIRIT/"
15+
VALID_NS_PREFIXES = {
16+
"http://www.spiritconsortium.org/XMLSchema/SPIRIT/",
17+
"http://www.accellera.org/XMLSchema/spirit/1685-2009",
18+
"http://www.accellera.org/XMLSchema/IPXACT/",
19+
}
1720

1821
class IPXACTImporter(RDLImporter):
1922

@@ -70,12 +73,12 @@ def get_component(self, tree: ElementTree.ElementTree) -> ElementTree.Element:
7073
if get_local_name(root) == "component":
7174
component = root
7275
namespace = get_namespace(root)
73-
if IPXACT_NAMESPACE_PREFIX in namespace:
74-
self.ns = namespace
75-
elif SPIRIT_NAMESPACE_PREFIX in namespace:
76-
self.ns = namespace
76+
for ns in VALID_NS_PREFIXES:
77+
if ns in namespace:
78+
self.ns = namespace
79+
break
7780
else:
78-
self.msg.fatal("Could not find a known ip-xact namespace")
81+
self.msg.fatal("Unrecognized namespace URI: %s" % namespace, self.src_ref)
7982
else:
8083
self.msg.fatal(
8184
"Could not find a 'component' element",

0 commit comments

Comments
 (0)