I'm replacing links in a RTF with an iframe wrapped with a div. I'm using <element name="div">
to create new tags. This works fine.
However, the XML rendered when i switch to the source tab contains an unwanted xmlns-attribute, that prevents me from saving the component!
What I am expecting is:
<div class="video-container">
And what I am getting is:
<div xmlns="http://www.w3.org/1999/XSL/Transform" class="video-container">
So with this xmlns attribute (since div
is not part of the XSL Transform schema), the error I am getting says:
(80040356) XML validation error. Reason: The element 'body' in namespace 'uuid:e3dc07b9-c583-461e-80ee-69a9cd39e596' has invalid child element 'div' in namespace 'http://www.w3.org/1999/XSL/Transform'. List of possible elements expected: any element in namespace 'http://www.w3.org/1999/xhtml'.. Unable to save new item
And if I try to explicitly set the namespace on the div with this:
<attribute name="xmlns">http://www.w3.org/1999/xhtml</attribute>
, then I get the following error:
Error: Attribute xmlns redefined
*UPDATED (before I only included the filtering XSLT part, now here's the whole schema) *
Here is my complete schema:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="uuid:e3dc07b9-c583-461e-80ee-69a9cd39e596" xmlns:tcmi="http://www.tridion.com/ContentManager/5.0/Instance" elementFormDefault="qualified" targetNamespace="uuid:e3dc07b9-c583-461e-80ee-69a9cd39e596"> <xsd:import namespace="http://www.tridion.com/ContentManager/5.0/Instance" schemaLocation="cm_xml_inst.xsd"></xsd:import> <xsd:annotation>
<xsd:appinfo>
<tcm:Labels xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<tcm:Label ElementName="body" Metadata="false">body</tcm:Label>
</tcm:Labels>
</xsd:appinfo> </xsd:annotation> <xsd:element name="Content">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="body" minOccurs="1" maxOccurs="unbounded" type="tcmi:XHTML">
<xsd:annotation>
<xsd:appinfo>
<tcm:ExtensionXml xmlns:tcm="http://www.tridion.com/ContentManager/5.0"></tcm:ExtensionXml>
<tcm:Size xmlns:tcm="http://www.tridion.com/ContentManager/5.0">10</tcm:Size>
<tcm:FilterXSLT xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" version="1.0">
<output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></output>
<template match="/ | node() | @*">
<copy>
<apply-templates select="node() | @*"></apply-templates>
</copy>
</template>
<!-- Convert Youtube and Xstream links into embedded iframes -->
<template match="a">
<element name="html:div">
<attribute name="class">video-container</attribute>
<element name="iframe">
<attribute name="width">695</attribute>
<attribute name="height">391</attribute>
<attribute name="src">
<text>http://www.youtube.com/embed/ero44g6ocCc</text>
</attribute>
<attribute name="frameborder">0</attribute>
<attribute name="allowfullscreen">true</attribute>
</element>
</element>
</template>
<!-- End of Youtube and Xstream block -->
<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>
<template name="FormattingFeatures">
<FormattingFeatures xmlns="http://www.tridion.com/ContentManager/5.2/FormatArea">
<Doctype>Transitional</Doctype>
<AccessibilityLevel>0</AccessibilityLevel>
<DisallowedActions></DisallowedActions>
<DisallowedStyles></DisallowedStyles>
</FormattingFeatures>
</template>
</stylesheet>
</tcm:FilterXSLT>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType> </xsd:element> </xsd:schema>
I'm running Tridion 2013.