Schematron: wrap consecutive uicontrol elements
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 42
- Joined: Wed Jun 20, 2018 11:30 am
Schematron: wrap consecutive uicontrol elements
Post by pieterjan_vdw »
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>
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Schematron: wrap consecutive uicontrol elements
Hello,
I don't understand all the usecase of your rule. Maybe it is easier if you check the number of uicontrol elements, something like this:
Best Regards,
Octavian
I don't understand all the usecase of your rule. Maybe it is easier if you check the number of uicontrol elements, something like this:
Code: Select all
<sch:pattern id="uicontrol-menuscascade">
<sch:rule id="uicontrol" context="uicontrol[not(ancestor::menucascade)]">
<sch:report test="count(parent::node()/uicontrol) > 1">
Wrap consecutive uicontrol elements
</sch:report>
</sch:rule>
</sch:pattern>
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 42
- Joined: Wed Jun 20, 2018 11:30 am
Re: Schematron: wrap consecutive uicontrol elements
Post by pieterjan_vdw »
Hi Octavian,
This was indeed very complex.
Thanks for the suggestion.
Kind regards,
PJ
This was indeed very complex.
Thanks for the suggestion.
Kind regards,
PJ
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)
- ↳ 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