Repository navigation
Support milestone citeStructures nested under a non-traversing parent - #36
Merged
Merged
Conversation
A citeStructure such as match="/TEI/text/body/div" with a child matching ".//milestone[@Unit='section']" was unusable: the same @n value occurs in every chapter, and the parent path is absolute, so nothing scoped the child to its own parent. - normalize_xpath: drop the "." step a ".//" child match produces, which made reconstruct_doc copy the parent twice (<div n="7"><div n="7">). - reverse_ancestor: that same "." step generated the invalid "[ancestor::]" (XPST0003). - _get_sibling_xpath: bind $end with head(), several siblings could match the boundary xpath and "<<" rejects a sequence (XPTY0004). - get_passage: always prefer a concrete boundary node over a tag/attribute xpath fragment, which otherwise matched a later chapter's section and over-copied. _prune_at_node prunes at a node, and _treat_siblings excludes the sibling that contains the boundary from the "<<" copy (it starts before it) to copy it pruned instead. - get_next_unit_boundary: a unit with no next sibling fell through to COPY_UNTIL_END, returning the rest of the document (157KB for one section). It now stops at the next unit of the same kind, clamped to the end of its own parent so a section never reaches into the next chapter. - find_refs / _resolve_groups: a child match written "//x" joined to ".///x"; treat it as ".//x", like generate_xpath already does. - find_refs: raise a located error on an empty citation value instead of "Reference '' does not match the expected format." further down.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A citeStructure such as match="/TEI/text/body/div" with a child matching ".//milestone[@Unit='section']" was unusable: the same @n value occurs in every chapter, and the parent path is absolute, so nothing scoped the child to its own parent.