To restrict the p tags and br tags in Tridion RTF fields I am writing XSLT code. But at any time only one tag I can able to remove with the following code. Please correct me where I am doing wrong. Input XML:
<html>
<body>
<p>This is the content in p tag.</p>
<br/><br/>
Content after br tag.
</body>
</html>
Expected output:
<html>
<body>
This is the content in p tag.Content after br tag.
</body>
</html>
XSLT written in Schema source:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xh="http://www.w3.org/1999/xhtml">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="p|br">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
When I am trying the same code in online XSLT editors it is working fine. But when I test in Tridion it is not working. I also referred Bart Koopman post for this question. Thanks in Advance.