XML/XSL newbie here, so please forgive my ignorance. This is the xml input given to me:
<entry>
<desc>
<p>Lorem ipsum <a href="http://www.google.com">dolor</a> sit amet.</p>
<p>Lorem <strong>ipsum</strong> dolor sit amet.</p>
</desc>
</entry>
I must write an XSL to get this result:
<p>Lorem ipsum <a href="http://www.google.com">dolor</a> sit amet.</p>
<p>Lorem <strong>ipsum</strong> dolor sit amet.</p>
I thought this would work, in an entry template:
<xsl:value-of select="desc"/>
but instead this is the output of the above line:
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
Am I correct in assuming there must be other xsl stylesheets on my system that do that? In any case, I have neither read not edit access to them, I can only add a new stylesheet, so to fix this I used this:
<xsl:for-each select="desc/*">
<p><xsl:value-of select="."/></p>
</xsl:for-each>
This gets me, at least:
<p>Lorem ipsum dolor sit amet.</p><p>Lorem ipsum dolor sit amet.</p>
However as you can see links and formatting have gone bye bye! I have no control on the kind of html elements that get added in there. Can anybody suggest a way to preserving the formatting and all of the desc element? The engine is XSL 1 only. Thanks in advance!