Skip to main content
Tweeted twitter.com/#!/StackTridion/status/330786236425986048
added 108 characters in body
Source Link
Chris Morgan
  • 7.3k
  • 17
  • 32

When saving to a rich text field via Core Service my HTML is not as desired. During create tags like:

<a id="abc" name="abc"></a>

becomesbecome:

<a id="abc" name="abc"/>

I have added to the XSLT to try and prevent this:

<template match="a[(@name) and (count(node()) = 0)]">
   <copy>
      <apply-templates select="@*"></apply-templates>
      <span class="hidden"></span>
   </copy>
</template>

but no joy!

IfIt seems to apply the base XSLT when creating via Core Service. Then if I open the component and make a change thenany changes my updated XSLT appies and the tags updateHTML updates to:

<a id="abc" name="abc">
   <xhtml:span xmlns:xhtml="http://www.w3.org/1999/xhtml" class="hidden"></xhtml:span>
</a>

When saving to a rich text field via Core Service my HTML is not as desired. During create

<a id="abc" name="abc"></a>

becomes

<a id="abc" name="abc"/>

I have added to the XSLT to try and prevent this

<template match="a[(@name) and (count(node()) = 0)]">
   <copy>
      <apply-templates select="@*"></apply-templates>
      <span class="hidden"></span>
   </copy>
</template>

but no joy!

If I open the component and make a change then the tags update to

<a id="abc" name="abc">
   <xhtml:span xmlns:xhtml="http://www.w3.org/1999/xhtml" class="hidden"></xhtml:span>
</a>

When saving to a rich text field via Core Service my HTML is not as desired. During create tags like:

<a id="abc" name="abc"></a>

become:

<a id="abc" name="abc"/>

I have added to the XSLT to try and prevent this:

<template match="a[(@name) and (count(node()) = 0)]">
   <copy>
      <apply-templates select="@*"></apply-templates>
      <span class="hidden"></span>
   </copy>
</template>

but no joy!

It seems to apply the base XSLT when creating via Core Service. Then if I open the component and make any changes my updated XSLT appies and the HTML updates to:

<a id="abc" name="abc">
   <xhtml:span xmlns:xhtml="http://www.w3.org/1999/xhtml" class="hidden"></xhtml:span>
</a>
Source Link
Chris Morgan
  • 7.3k
  • 17
  • 32

Creating Rich Text Field via Core Service

When saving to a rich text field via Core Service my HTML is not as desired. During create

<a id="abc" name="abc"></a>

becomes

<a id="abc" name="abc"/>

I have added to the XSLT to try and prevent this

<template match="a[(@name) and (count(node()) = 0)]">
   <copy>
      <apply-templates select="@*"></apply-templates>
      <span class="hidden"></span>
   </copy>
</template>

but no joy!

If I open the component and make a change then the tags update to

<a id="abc" name="abc">
   <xhtml:span xmlns:xhtml="http://www.w3.org/1999/xhtml" class="hidden"></xhtml:span>
</a>