diff --git a/scripts/doc/linked-xml-file.py b/scripts/doc/linked-xml-file.py
index bef1083fc24f738113b020db779109ecf964dfd1..26d1db2fe455540d25f810ed3549e380945e6900 100755
--- a/scripts/doc/linked-xml-file.py
+++ b/scripts/doc/linked-xml-file.py
@@ -54,12 +54,12 @@ def format_if_documented(
 def replace_prefix(tag: str, typetag: str) -> str:
     "Replaces prefix to match the different docs structure for some tags."
 
-    type_prefix = "" if typetag is None else typetag + "."
-    if (prefix := "prj.processes.process.constitutive_relation.") in tag:
-        tag = tag.replace(prefix, "material.solid.constitutive_relation." + type_prefix)
+    type_prefix = "" if typetag is None else typetag + "__"
+    if (prefix := "prj__processes__process__constitutive_relation__") in tag:
+        tag = tag.replace(prefix, "material.solid.constitutive_relation__" + type_prefix)
 
-    for prefix_end in ["phases.phase.", "phases.", ""]:
-        if (prefix := "prj.media.medium." + prefix_end) in tag:
+    for prefix_end in ["phases__phase__", "phases__", ""]:
+        if (prefix := "prj__media__medium__" + prefix_end) in tag:
             if "property" not in tag:  # excludes parent tags
                 return tag
             tag = tag.replace(prefix, "")
@@ -70,7 +70,7 @@ def replace_prefix(tag: str, typetag: str) -> str:
 def get_tagpath(
     page_name: str, typetag: str, typetag_levels_up: int
 ) -> tuple[str, str, bool]:
-    tag_path = replace_prefix(page_name.replace("__", "."), typetag)
+    tag_path = replace_prefix(page_name, typetag).replace("__", ".")
     is_doc = (tag_path, True) in documented_tags_attrs
     if not is_doc and typetag:
         tag_path_parts = tag_path.split(".")
@@ -80,6 +80,8 @@ def get_tagpath(
         if is_doc:
             tag_path = tagpath_new
             page_name = tag_path.replace(".", "__")
+    else:
+        page_name = tag_path.replace(".", "__")
 
     return tag_path, page_name, is_doc
 
@@ -214,7 +216,6 @@ with open(
             method = line[6]
             is_tag = method.find("Attribute") == -1
             documented_tags_attrs.add((tagpath, is_tag))
-            # print_(tagpath, is_tag)
 
 
 def has_prj_file_in_subdirs(rel_dirpath: str) -> bool: