I'm trying to replace a link with an iframe in a rich text field but I can't get it to work. Somehow, it is not accepting the iframe-tag, or other tags for that matter. In the end, I'm trying to achieve transforming a link to a Youtube video to an embedded iframe to the same url.
Below is the filtering XSLT that I have specified for my rich text field. It should match all a-elements, and replace them with an iframe to google and also show the text "The link should have been converted to an iframe!". Currently what is happening is that the text is shown, but the iframe is nowhere to be seen. I have tested with other tags as well, for example "strong", but it never gets through either.
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- changed by carl-david: <output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></output> -->
<output method="html" indent="yes"></output>
<template match="/ | node() | @*">
<copy>
<apply-templates select="node() | @*"></apply-templates>
</copy>
</template>
<template match="a">
<iframe src="http://www.google.com"></iframe>
<text>The link should have been converted to an iframe!</text>
</template>
<template match="*[ (self::br or self::p or self::div) and normalize-space(translate(., ' ', '')) = '' and not(@*) and not(processing-instruction()) and not(comment()) and not(*[not(self::br) or @* or * or node()]) and not(following::node()[not( (self::text() or self::br or self::p or self::div) and normalize-space(translate(., ' ', '')) = '' and not(@*) and not(processing-instruction()) and not(comment()) and not(*[not(self::br) or @* or * or node()]) )]) ]">
<!-- ignore all paragraphs and line-breaks at the end that have nothing but (non-breaking) spaces and line breaks -->
</template>
<template match="br[parent::div and not(preceding-sibling::node()) and not(following-sibling::node())]">
<!-- Chrome generates <div><br/></div>. Renders differently in different browsers. Replace it with a non-breaking space -->
<text> </text>
</template>
Any idea of why it doesn't allow me to create new tags?