0

I am creating component using Core Service by having required input in XML file. I am creating component's content XML from XML file using Core Service and setting to component object, same method for component's metadata also, everything works fine as expected except Rich Text Box Field.

For a rich text field, when i try to set a value, I am getting XML validation error.

The value what i am setting is This field is <b>RichText</b> Field.

The Error is XML validation error. Reason: The element 'componentText' in namespace 'uuid:fca19417-fbed-4008-aab2-213023f0eed2' has invalid child element 'b' in namespace 'uuid:fca19417-fbed-4008-aab2-213023f0eed2'.

When i try to set like this This field is <b xmlns="http://www.w3.org/1999/xhtml">RichText</b> Field it work's fine.

I understand that i need to pass the namespace as well. I have gone through the lot of questions on the same topic, however all the methods are setting the input text with relevant namespace like what i am setting at the last. But this will be difficult for the business user perspective.

I would like to know how can i handle (html to xhtml) this in best way to add the required namespace before i set the content?

2
  • What do you mean by the 'business user perspective'? Surely this is a technical issue. What will your business users need to do? Commented Nov 12, 2014 at 8:28
  • @Dominic: Yes this is an technical perspective only. My question is also from technical perspective to convert HTML to XHTML.
    – Jey
    Commented Nov 12, 2014 at 10:18

1 Answer 1

1

A good approach to convert HTML to XHTML is using Tidy.net along with a bit of code written and described in a post by Nuno here: http://nunolinhares.blogspot.ca/2011/06/importing-content-into-tridion.html

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.