Looping in schematron
Posted: Tue May 10, 2016 9:12 am
Hi team,
I would like to create a schematron rule which can be looped through the element content. The need is that I need to check the number of characters before a line break and should loop through the content finding next line break. This is for pre-formatted elements. The warning is for adding more number of characters in a line than allowed.
I have done below coding but it works only for one line break:
Please let me know if you have a way forward for me on this
Thanks,
Shabeer
I would like to create a schematron rule which can be looped through the element content. The need is that I need to check the number of characters before a line break and should loop through the content finding next line break. This is for pre-formatted elements. The warning is for adding more number of characters in a line than allowed.
I have done below coding but it works only for one line break:
Code: Select all
<pattern>
<rule id="1" context="*[contains(@class,'- topic/pre ')]">
<assert test="string-length(substring-before(.,' ')) < 50 " role="warning"> Do not exceed number of characters in a line in pre than 50
</assert>
</rule>
</pattern>
Thanks,
Shabeer