Schematron: wrap consecutive uicontrol elements
Posted: Fri Apr 24, 2020 6:31 pm
Hi,
I would like to add a Schematron rule to check consecutive uicontrol elements and suggest to use menucascade.
I have a problem when a space is added between two <uicontrol> elements.
When the file is indented like this it does work:
When it's indented like in below example it doesn't not work.
In author mode in Oxygen a space is added, but this is not visible in the text mode.
This is my code right now
How should I change it to make it work?
I would like to add a Schematron rule to check consecutive uicontrol elements and suggest to use menucascade.
I have a problem when a space is added between two <uicontrol> elements.
When the file is indented like this it does work:
Code: Select all
<p><uicontrol/> <uicontrol/></p>
In author mode in Oxygen a space is added, but this is not visible in the text mode.
Code: Select all
<p><uicontrol/>
<uicontrol/>
</p>
Code: Select all
<sch:pattern id="uicontrol-menuscascade">
<sch:rule id="uicontrol" context="uicontrol[not(ancestor::menucascade)]">
<sch:report test="starts-with(following::text()[1][normalize-space()], ' > ') or starts-with(concat(following-sibling::text()[1][normalize-space()][matches(., '^\s', ';j')],following-sibling::node()[1][contains(.,uicontrol)]), ' ')"/>
</sch:rule>
</sch:pattern>