Excluding specific XML elements from word count in Vale
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 6
- Joined: Fri Nov 22, 2024 9:59 am
Excluding specific XML elements from word count in Vale
Hello,
I'm working on some Vale rules to use with the terminology plugin to check terminology and other style guidelines.
I'm wondering if there's a way to exclude certain elements (like uicontrol or xref) when counting words within a sentence (or to count them as a single word regardless of their length).
So far, I only have a rule that counts all words, no matter which elements they’re in:
Is this even possible to achieve with Vale or the terminology plugin?
Thank you.
I'm working on some Vale rules to use with the terminology plugin to check terminology and other style guidelines.
I'm wondering if there's a way to exclude certain elements (like uicontrol or xref) when counting words within a sentence (or to count them as a single word regardless of their length).
So far, I only have a rule that counts all words, no matter which elements they’re in:
Code: Select all
extends: occurrence
message: "sentence too long"
scope: sentence
level: suggestion
max: 25
token: \b(\w+)\b
Thank you.
-
- Posts: 79
- Joined: Wed Jun 22, 2016 2:48 pm
Re: Excluding specific XML elements from word count in Vale
Post by adrian_sorop »
Hi,
There isn’t a direct way to exclude elements when counting words within a sentence, nor to count them as a single word.
However, there might be a workaround: the Terminology Checker skips space-preserve elements. If your elements use a style such as white-space:pre, they won’t be scanned.
If you create an alternate style that marks xref, uicontrol, etc. as space-preserve, the Terminology Checker will skip these elements.
Here is the latest documentation regarding CSS styling:
https://www.oxygenxml.com/doc/versions/ ... tyles.html
Regards,
Adrian S.
There isn’t a direct way to exclude elements when counting words within a sentence, nor to count them as a single word.
However, there might be a workaround: the Terminology Checker skips space-preserve elements. If your elements use a style such as white-space:pre, they won’t be scanned.
If you create an alternate style that marks xref, uicontrol, etc. as space-preserve, the Terminology Checker will skip these elements.
Here is the latest documentation regarding CSS styling:
https://www.oxygenxml.com/doc/versions/ ... tyles.html
Regards,
Adrian S.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service