我正在使用ASP.Net的内置类为网站创建XML Feed。下面的代码我有,使用HTML标记格式化XML Feed中的Title元素
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标签的方法?
如果这是您使用html解码的实际情况,或者您可以在xml文件中进行更改,则可以将数据保存在CDATA块中。 – 2012-07-30 16:00:54
都尝试过,但似乎没有效果。 – itsbalur 2012-07-30 16:10:55