Skip to content
Snippets Groups Projects
Verified Commit 1428923c authored by Thibault Ehrhart's avatar Thibault Ehrhart
Browse files

feat(augment_yin): remove leading slash from target-node attribute

parent d2f3e253
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,14 @@ def augment_element(
]:
# Generate ID attribute
name = element.attrib.get("name") or element.attrib.get("target-node")
# Remove leading slash from target-node if present (especially for deviations)
if name and name.startswith("/"):
name = name.lstrip("/")
# Update the actual target-node attribute if it exists
if "target-node" in element.attrib:
element.attrib["target-node"] = name
if parent_id == module_name:
current_id = name
else:
......@@ -143,6 +151,13 @@ def augment_element(
for child in element:
child_name = child.attrib.get("name") or child.attrib.get("target-node")
if child_name:
# Remove leading slash if present
if child_name.startswith("/"):
child_name = child_name.lstrip("/")
# Update the actual target-node attribute if it exists
if "target-node" in child.attrib:
child.attrib["target-node"] = child_name
if child_name in child_counts:
child_counts[child_name] += 1
child.set(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment