Skip to content

Commit

Permalink
Bug fix:
Browse files Browse the repository at this point in the history
Constraint was looking for _all_ descendant text nodes of eg element,
not just child text nodes. That means that if there is any phrase-level
encoding in an eg element there is more than one text node that has (for
example) position()=last(), and the XPath fails because only one item is
allowed as the first argument to matches().
  • Loading branch information
sydb committed Dec 4, 2024
1 parent 4564bbf commit d1a17a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions P5/p5odds.odd
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@
</desc>
<constraint>
<sch:rule context="tei:eg">
<sch:report test="matches( .//text()[last()], '&#x0A;\s*$')">trailing newline not allowed</sch:report>
<sch:report test="matches( .//text()[1], '^\s*&#x0A;')">leading newline not allowed</sch:report>
<sch:report test="matches( ./text()[last()], '&#x0A;\s*$')">trailing newline not allowed</sch:report>
<sch:report test="matches( ./text()[1], '^\s*&#x0A;')">leading newline not allowed</sch:report>
</sch:rule>
</constraint>
</constraintSpec>
Expand Down

0 comments on commit d1a17a0

Please sign in to comment.