Replace tags while keeping text

Posts: 4
Joined: Fri Jan 13, 2017 7:35 pm

Replace tags while keeping text

Post by frodos_pants » Tue May 02, 2017 4:50 am


I have an authoring template which has some questions. Most of the questions are just regular questions.

<li class="question">
<p>Question text</p>

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>

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.


Posts: 7579
Joined: Fri Jul 09, 2004 5:18 pm

Re: Replace tags while keeping text

Post by Radu » Tue May 02, 2017 8:13 am

Hi Tom,

The XSLTOperation should be documented here: ... 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.

Radu Coravu
<oXygen/> XML Editor

Post Reply