This is a migrated thread and some comments may be shown as answers.

Emiting raw XML from Data Source

1 Answer 90 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 02 Oct 2014, 05:32 PM
I have a data source that is bound to an XML file. The XML file in many places contains XHTML nested inside the elements. In those cases, I need the raw XHTML to be emitted into the template.
So for the linked example, I would expect the template to emit the raw XHTML below:

<body xmlns="http://www.w3.org/1999/xhtml">Markup<br/>(11th District)</body>

How can I accomplish this?

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 06 Oct 2014, 12:12 PM
Hello John,

Here is the updated sample that shows how to do this. There are some issues that had to be resolved:

  • inserting the <body> element within the existing document is rather illegal HTML. This has been changed to а <div> element.
  • nesting HTML directly within XML produces strange object hierarchies. Instead, you should encode the HTML and access it via the text() accessor
Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
John
Top achievements
Rank 2
Answers by
Alex Gyoshev
Telerik team
Share this question
or