Say I have the following in an XHTML page:
<span style="color:#555555; font-style:italic">some text</span>
How would I go about transforming this to:
<span style="color:#555555;"><em>some text</em></span>
Say I have the following in an XHTML page:
<span style="color:#555555; font-style:italic">some text</span>
How would I go about transforming this to:
<span style="color:#555555;"><em>some text</em></span>
Just for fun, a more general XSLT 2.0 solutions (can be optimized):
Output:
This is not as easy as it seems since XSLT is not the best tool for string parsing - but that's exactly what you need to get the contents of the style attribute right generically.
However, depending on the complexity of your input, something like this might be enough (I tried to be as generic as possible, though):