Skip to content

Commit

Permalink
Better fix:
Browse files Browse the repository at this point in the history
Per suggestion of @martindholmes, instead of trying to select the correct
descendant text node(s), just examine the string value of the entire eg
element as a whole. The string() function call is not technically necessary
(because matches() wants a string there, it would happen automagically),
but its use makes what we are doing explicit and obvious.
  • Loading branch information
sydb committed Dec 4, 2024
1 parent d1a17a0 commit 0aeb34c
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( string(.), '&#x0A;\s*$')">trailing newline not allowed</sch:report>
<sch:report test="matches( string(.), '^\s*&#x0A;')">leading newline not allowed</sch:report>
</sch:rule>
</constraint>
</constraintSpec>
Expand Down

0 comments on commit 0aeb34c

Please sign in to comment.