Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
feat:print info from offending files
Browse files Browse the repository at this point in the history
  • Loading branch information
BobBorges committed Dec 12, 2023
1 parent 7897e33 commit 57536b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/next_prev.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,20 @@ def check_next_prev_coherence(root):
prev_id = None

for body in root.findall(f".//{TEI_NS}body"):
for div in root.findall(f".//{TEI_NS}div"):
for elem in div:
for elem in root.findall(f".//{TEI_NS}u"):
#for elem in div:
if elem.tag == f"{TEI_NS}u":

if next_attrib is not None:
if next_attrib != elem.attrib[f"{XML_NS}id"]:
print(next_attrib, elem.attrib[f"{XML_NS}id"])
return False

next_attrib = elem.attrib.get("next")

if "prev" in elem.attrib:
if prev_id != elem.attrib["prev"]:
print(next_attrib, elem.attrib["prev"])
return False

prev_id = elem.attrib[f"{XML_NS}id"]
Expand Down

0 comments on commit 57536b6

Please sign in to comment.