0

I am trying to Parse the content for a RTF Field as same as it done when we move from Design tag to source tag, after we parse the content, same will be used to update component through API call

How can I specifically decode the content other than HTML Tags

3
  • What exactly do you need to do, are you talking about applying the XSLT manually? Commented Oct 13, 2016 at 9:46
  • Yes, I have an input content something like this & < > <a href="&">Testing</a> where I need to parse the content as same as Tridion does &amp; &lt; &gt; <a href="&amp;">Testing</a>
    – Kumar_diru
    Commented Oct 13, 2016 at 9:58
  • 1
    I think the question is about replicating the XSLT rich text filter behavior that happens in the CME but when using the Core Service. Commented Oct 14, 2016 at 6:42

1 Answer 1

2

When you select the Source tab in an RTF field, the Tridion GUI applies an XSLT against the XHTML that exists; this causes the escaping of the HTML you seem to desire.

The same action is undertaken when you select Save in the GUI.

The XSLT is located in the Schema as a property of the RTF field - you will see a button titled Edit Formatting Features and the XSLT is prompted when you click this and then select the Filtering XSLT tab.

You simply need to apply the same XSLT (which you'd probably need to hand manage between where your original input is and the Tridion Schema - although in my experience this will VERY rarely be updated).

Where and how you apply that will depend on where you are needing to do the transformation (there's a very high degree of guesswork here as your question is far from clear and would benefit from a lot more context of the actual requirement)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.