Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get div structure: do not require div hierarchy #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions mets_mods2tei/api/tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,13 +841,12 @@ def add_div_structure(self, div, pages=None):
while div.get_ADMID() is None:
self.logger.debug("Found logical outer div type %s: %s", div.get_TYPE(), div.get_ID())
div = div.get_div()[0]
start_div = div.get_div()[0]
self.logger.debug("Found logical inner div type %s: %s", start_div.get_TYPE(), start_div.get_ID())
start_div = div
while start_div.get_div() and start_div.get_div()[0].get_ADMID() is not None:
self.logger.debug("Found logical inner div type %s: %s", start_div.get_TYPE(), start_div.get_ID())
div = start_div
start_div = start_div.get_div()[0]

entry_point = front

for sub_div in div.get_div():
Expand Down