Page 1 of 1

[Schematron] Forbidden words

Posted: Fri Feb 04, 2022 6:21 pm
by odurand47
I have a Schematron rule to detect forbidden words, it works well, but I can't show just the word to modify in the paragraph. The interface shows only the beginning of the paragraph as in the attached image
fWords.png
.
Here is my code, I tried several things without ever finding the solution maybe it is impossible to underline just the word in a paragraph with Schematron?

Code: Select all

		<sch:rule context="//text()">
			<sch:report role="warn" test="(not (normalize-space('will')='')
			and parent::node()/local-name() != 'ph'">
				The word "will" should not be used.
			</sch:report>
		</sch:rule>

Re: [Schematron] Forbidden words

Posted: Mon Feb 07, 2022 8:49 am
by Radu
Hi,
The Schematron validation highlights entire elements based on the validation rules you write, so you cannot highlight a specific word in the text content using Schematron rules. We have an internal issue for this and if we manage to implement it we'll update this forum thread.
In the meantime I would recommend our free to use Terminology Checker add-on:
https://www.oxygenxml.com/doc/versions/ ... addon.html
As an example we use it for the Oxygen user's manual with the Microsoft Style Guide rules taken from the Vale project:
https://github.com/oxygenxml/userguide/ ... rm-checker

Regards,
Radu

Re: [Schematron] Forbidden words

Posted: Thu Feb 10, 2022 2:21 am
by chrispitude
I will add my vote for Terminology Checker!

We were using Schematron for our style guide checks on text() elements, and we hit the same limitation that only the beginning of the text() elements are highlighted.

When the recent 3.0.0 update to Terminology Checker came out, I saw that it had some enhancements I was waiting for, and I decided to try it out. I am happy to say that it works very well! It is a big step forward for our style guide checks.

Terminology Checker checks are also easier to write than Schematron checks. And I was able to write a quick perl script that converted our Schematron regular-expression checks on text() elements to Terminology Checker regular-expression checks, which made migration very easy.

Plus, you can check an entire book on-demand by right-clicking the map in the DITA Maps Manager and running Terminology Checker from there.

We do have some XPath-specific checks that must remain in Schematron for now. We filed EXM-48448 for Terminology Checker to support XPath-specific checks.

We also filed EXM-48463 for Terminology Checker to consider the "Ignore elements" list used by spell-checking and AutoCorrect (defined in Preferences > Editor > Spell Check), so all the textual features are consistent with each other.