I am trying to remove the break tags from a string in xslt1.0. I tried using translate(s,’<br>’,”) where s is string value but that removes the bold tags also. Also tried a template but had no luck.
My question is how to remove the break tags only.
So the string:
<b>trying</b> to remove <br> tags only <br> and not <b>bold tags</b>
would be parsed as:
<b>trying</b> to remove tags only and not <b>bold tags</b>
This XSLT:
applied to this well-formed, valid XML:
gives this result:
Also refer to Dimitre’s solution here:
Removing empty tags from XML via XSLT