Asp.net 使用HTML标记格式化XML提要中的标题元素

Asp.net 使用HTML标记格式化XML提要中的标题元素,asp.net,feed,syndicationfeed,Asp.net,Feed,Syndicationfeed,我正在使用ASP.Net的内置类为网站创建XML提要。这是我的密码 SyndicationFeed myFeed = new SyndicationFeed(); myFeed.Title = TextSyndicationContent.CreatePlaintextContent ("XYZ - In the first line <br/> in the second line"); 渲染时,它会按原样显示- XYZ - In the first line

我正在使用ASP.Net的内置类为网站创建XML提要。这是我的密码

SyndicationFeed myFeed = new SyndicationFeed();
myFeed.Title = TextSyndicationContent.CreatePlaintextContent
("XYZ  - In the first line <br/> in the second line");
渲染时,它会按原样显示-

XYZ  - In the first line <br/> in the second line
而我想要它

XYZ  - In the first line 
in the second line
我发现该行为仅适用于myFeed.Title,而在myFeed.Description中,我可以使用任何HTML标记


有没有办法让HTML标记与标题一起工作?

请改用。SyndicationContent.CreatePlaintextContent始终转义文本以使其按字面形式呈现。

如果这是您使用html解码的实际情况,或者如果您可以在xml文件中进行更改,则可以将数据保留在CDATA块中。尝试了这两种方法,但似乎没有效果。我尝试了此选项,但是HTML标记没有被应用。如果你看原始提要内容,标记是否正确显示在那里?这可能是客户端呈现问题。是的,提要内容在源中显示正确。这可能是一个客户端问题,但它在IE8/9或Mozilla 14中都无法正常工作。我需要让他们至少在IE中工作。