Removal of generated text in particular element

Post here questions and problems related to editing and publishing DITA content.
Raga Mounika
Posts: 49
Joined: Mon Mar 28, 2016 3:54 pm

Removal of generated text in particular element

Post by Raga Mounika »

Hi Team,

When <steps> is used I am getting "Steps" generated text. Now according to my customization
I dont need "Steps" generated text when <steps> is inserted in <remedy> element.
The code I used here is

Code: Select all

*[class~="task/steps"]:before(10) {
content:"Steps ";
font-weight:bold;
}
*[class~='troubleshooting/remedy']{
-oxy-foldable: false;
content:"Remedy ";
}
remedy:not(title){
content:"Remedy ";
font-weight: bold;
}
remedy > *{
font-weight:normal;
}
*[class~='troubleshooting/remedy']! > [class~='topic/title'] {
content:"Remedy: ";
}
I already tried using the not selector. But it is not working

Code: Select all

*[class~="task/steps"]:not(remedy):before(10) {
content:"Steps ";
font-weight:bold;
}
Please help me to remove the "Steps" text when <steps> is inserted in <remedy>.

Thank you!

BR
Mounika
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Removal of generated text in particular element

Post by Radu »

Hi Mounika,

You do not need the has() selector to solve this.
This CSS selector you tried *[class~="task/steps"]:not(remedy) means something like "the steps element which does not have the remedy element inside it" and you want to express "the steps element which is not inside the remedy".
So if the CSS selector which adds the "Steps" looks like this:

Code: Select all

*[class~="task/steps"]:before(10) {
content:"Steps ";
font-weight:bold;
}
the extra added CSS selector which avoids adding the "Steps" when the <steps> is inside a <remedy> would look like this:

Code: Select all

remedy > *[class~="task/steps"]:before(10) {
content:"";
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Raga Mounika
Posts: 49
Joined: Mon Mar 28, 2016 3:54 pm

Re: Removal of generated text in particular element

Post by Raga Mounika »

Hi Radu,

Thanks for the reply . It works :)

BR,
Mounika
Post Reply