Use terminology checker to flag missing short description

Post here questions and problems related to editing and publishing DITA content.
Jeff_Reynolds
Posts: 37
Joined: Tue Apr 13, 2021 9:48 pm

Use terminology checker to flag missing short description

Post by Jeff_Reynolds »

Hello!

I have been having rollicking success creating rules with the terminology checker add-on. I was wondering if the tool can support a check for the short description element and throw a warning if it is not present in the topic. If so, how would one code that?

Maybe time to learn schematron?
Radu
Posts: 9461
Joined: Fri Jul 09, 2004 5:18 pm

Re: Use terminology checker to flag missing short description

Post by Radu »

Hi Jeff,

The term checker checks only text content, it does not check structure.
If you want structure checks, then indeed you would need Schematron.
https://blog.oxygenxml.com/topics/shari ... rules.html
A Schematron file doing what you want would probably look something like this:

Code: Select all

<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
  <pattern>
    <rule context="topic">
      <assert test="shortdesc">Short description is missing</assert>
    </rule>
  </pattern>
</schema>
As a hint you can also try to use ChatGPT to generate Schematron patterns or entire schemas, for example give a prompt like:
generate an ISO schematron which reports an error if the short description element is missing from a DITA XML topic. DITA XML topics are in no namespace.
ChatGPT may generate an invalid Schematron schema which needs to be corrected in Oxygen afterwards but it gives you something to start with.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply