Schematron Quick Fix to Remove Part of an Attribute Value!
Post here questions and problems related to editing and publishing DITA content.
Schematron Quick Fix to Remove Part of an Attribute Value!
Hi team,
We are working on adding some schematron quick fixes to some of our specialized schematron rules in oXygen Author 19.1 Eclipse version.
We are stuck in a place that we need to remove part of an attribute value using schematron quick fix.
Consider the below example,
If a user inserts we would need to show a message that @outputclass="value1" is not allowed for table, and we need to give a quick fix to remove "value1" from @outputclass. We are now using the below snippet, where it completely removes the @outputclass attribute with the quick fix.
This is OK if user has defined only "value1" as a value. But if user defines "value2" also in the @outputclass, then it is not user friendly.
Can you suggest a way to remove only "value1" from @outputclass using quick fix instead of completely removing it if user gives multiple values in the @outputclass.
Thanks in advance!
Regards,
Shabeer
We are working on adding some schematron quick fixes to some of our specialized schematron rules in oXygen Author 19.1 Eclipse version.
We are stuck in a place that we need to remove part of an attribute value using schematron quick fix.
Consider the below example,
If a user inserts
Code: Select all
<table outputclass="value1 value2"/>
Code: Select all
<pattern>
<rule id="a_1" context="*[contains(@class,' topic/table ')]">
<report test="(contains(@outputclass,'value1'))"
role="warning" sqf:fix="remove_value1">Insertion of @outputclass="value1" is not supported
here for <xsl:value-of select="local-name(.)"/>. </report>
<sqf:fix id="remove_value1">
<sqf:description><sqf:title>Remove outputclass=value1</sqf:title></sqf:description>
<sqf:delete match="@outputclass"></sqf:delete>
</sqf:fix>
</rule>
</pattern>
This is OK if user has defined only "value1" as a value. But if user defines "value2" also in the @outputclass, then it is not user friendly.
Can you suggest a way to remove only "value1" from @outputclass using quick fix instead of completely removing it if user gives multiple values in the @outputclass.
Thanks in advance!
Regards,
Shabeer
Re: Schematron Quick Fix to Remove Part of an Attribute Value!
Hi Shabeer,
Maybe you could use "sqf:replace". There is a sample Schematron with quick fixes in the Oxygen installation folder:
OXYGEN_INSTALL_DIR\samples\quick-fixes\flowers.sch
and it has a couple of "sqf:replace" usage samples.
Regards,
Radu
Maybe you could use "sqf:replace". There is a sample Schematron with quick fixes in the Oxygen installation folder:
OXYGEN_INSTALL_DIR\samples\quick-fixes\flowers.sch
and it has a couple of "sqf:replace" usage samples.
Regards,
Radu
Radu Coravu
<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)
- ↳ 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