In Schematron quick-fix XSLT, can default attributes be suppressed?
Posted: Wed Oct 11, 2023 9:27 pm
I have a Schematron quick-fix that adds <glossAcronym> and <glossSurfaceForm> to a <glossEntry>. It does this by calling a small bit of XSLT to update the <glossEntry>.
When I run the quick-fix on this:
the result is this:
The newly added elements (<glossBody> and down) are fine. But the existing copied elements (<glossentry>, <glossterm>, and <glossdef>) get explicit copies of the normally-implicit attributes.
For now, I will add more refactoring code to strip them out, but it would be nice if this could somehow be handled automatically (if possible).
Testcase:
To run,
When I run the quick-fix on this:
Code: Select all
<glossgroup id="glossary">
<title>My Glossary</title>
<glossentry id="ddl">
<glossterm>DITA</glossterm>
<glossdef>This is some definition text.</glossdef>
</glossentry>
</glossgroup>
Code: Select all
<glossgroup id="glossary">
<title>My Glossary</title>
<glossentry class="- topic/topic concept/concept glossentry/glossentry "
ditaarch:DITAArchVersion="1.3"
domains="(topic abbrev-d) (topic concept glossentry) (topic concept glossgroup) (topic concept) (topic equation-d) (topic hazard-d) (topic hi-d) (topic indexing-d) (topic markup-d xml-d) (topic markup-d) (topic mathml-d) (topic pr-d) (topic relmgmt-d) (topic svg-d) (topic sw-d) (topic ui-d) (topic ut-d) a(props deliveryTarget)"
id="ddl">
<glossterm class="- topic/title concept/title glossentry/glossterm "/>
<glossdef class="- topic/abstract concept/abstract glossentry/glossdef ">This is some
definition text.</glossdef>
<glossBody>
<glossSurfaceForm/>
<glossAlt id="glossAlt_abf_sws_bzb">
<glossAcronym>DITA</glossAcronym>
</glossAlt>
</glossBody>
</glossentry>
</glossgroup>
For now, I will add more refactoring code to strip them out, but it would be nice if this could somehow be handled automatically (if possible).
Testcase:
To run,
- Open the project file.
- Open the glossary.dita file.
- Apply a Schematron quick-fix to the glossary term.