【发布时间】:2018-07-11 23:30:21
【问题描述】:
假设我有这个 xml 代码,我想在我的页面上显示它:
<?xml version=\"1.0\" encoding=\"UTF-8\" ?> <rss version=\"2.0\">
<channel>
<title>W3Schools Home Page</title>
<link>https://www.w3schools.com</link>
<description>Free web building tutorials</description>
<item>
<title>RSS
Tutorial</title>
<link>https://www.w3schools.com/xml/xml_rss.asp</link>
<description>New RSS tutorial on W3Schools</description> </item> </channel> </rss>
我试过这样做,但输出不是我想要的:
<div dangerouslySetInnerHTML={{ __html: this.state.body }} />
输出是这样的:
https://www.w3schools.com免费网络建设教程https://www.w3schools.com/xml/xml_rss.aspW3Schools上的新RSS教程
这不是我想要的。我希望它在我的页面上显示 rss 提要而不重定向我,我该怎么做? (顺便说一句,身体的读数非常好,所以问题不在于身体)
【问题讨论】: