Replace tags while keeping text
-
- Posts: 4
- Joined: Fri Jan 13, 2017 7:35 pm
Replace tags while keeping text
Post by frodos_pants »
Hi,
I have an authoring template which has some questions. Most of the questions are just regular questions.
<li class="question">
<p>Question text</p>
</li>
Some are going to have a downloadable file.
<li class="question">
<p>Question text</p>
<div class="download">
<a href="" class="ulink">Download this File</a>
</div>
</li>
I want to add a button to this so if the question has a downloadable file they can click a button to update the tagging. The button's no problem, but what's the best way to transform/change this? The question text will already exist when the decision is made regarding the downloadable file, so the button needs to change the tagging, and leave the text. I tried to use "ro.sync.ecss.extensions.commons.operations.XSLTOperation", but I can't find anything that shows examples of what to put in the available fields. Do you know where I could locate that? I'm not sure what to put into sourceLocation or targetLocation for example.
Thanks,
Tom
I have an authoring template which has some questions. Most of the questions are just regular questions.
<li class="question">
<p>Question text</p>
</li>
Some are going to have a downloadable file.
<li class="question">
<p>Question text</p>
<div class="download">
<a href="" class="ulink">Download this File</a>
</div>
</li>
I want to add a button to this so if the question has a downloadable file they can click a button to update the tagging. The button's no problem, but what's the best way to transform/change this? The question text will already exist when the decision is made regarding the downloadable file, so the button needs to change the tagging, and leave the text. I tried to use "ro.sync.ecss.extensions.commons.operations.XSLTOperation", but I can't find anything that shows examples of what to put in the available fields. Do you know where I could locate that? I'm not sure what to put into sourceLocation or targetLocation for example.
Thanks,
Tom
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Replace tags while keeping text
Hi Tom,
The XSLTOperation should be documented here:
https://www.oxygenxml.com/doc/versions/ ... tions.html
in your case if the button is added by the CSS selectors on the <li> element then the sourceLocation needs to remain unassigned (as the source is the current element). The targetLocation again must remain with the default value because you want to replace the current element. The XSLT script will receive as content the current <li> on which the button is placed and needs to process it. You can use xsl:message's in the XSLT script to debug your progress.
Regards,
Radu
The XSLTOperation should be documented here:
https://www.oxygenxml.com/doc/versions/ ... tions.html
in your case if the button is added by the CSS selectors on the <li> element then the sourceLocation needs to remain unassigned (as the source is the current element). The targetLocation again must remain with the default value because you want to replace the current element. The XSLT script will receive as content the current <li> on which the button is placed and needs to process it. You can use xsl:message's in the XSLT script to debug your progress.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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