【问题标题】:Parse JSON to XML将 JSON 解析为 XML
【发布时间】:2016-09-15 04:38:01
【问题描述】:

我将 json 解析为 xml 并得到如下结果,但 xml 提要未在我的服务器中显示结果。任何人都可以检查并给我一些想法吗?我需要在仪表板上显示 XML 结果。这是实际 URL (http://imodelicon.com/pinkertan/test/convertjson.xml)

我也将 XML 脚本编辑成 RSS 格式,但之后就没有内容了。

谢谢,

<?xml version="1.0" encoding="UTF-8"?>
-<root>
-<data>
<message>This summer both Stephen Curry & Kevin Durant toured Asia,   
connecting with fans & inspiring young athletes. ???? »    
http://on.nba.com/2bWpo3L ???? » http://on.nba.com/29LfO6X</message>

<story>Golden State Warriors added 4 new photos.</story>

<created_time>2016-09-15T01:03:28+0000</created_time>

<id>47657117525_10154616463827526</id>

</data>
-<data>

<message>The worlds of sports & tech came together once again as Stephen   
Curry attended TechCrunch Disrupt in San Francisco. #TCDisrupt</message>

<created_time>2016-09-14T23:21:38+0000</created_time>

<id>47657117525_10154616220367526</id>

</data>
-<data>

<message>All Summer 16. #DubNation</message>

<created_time>2016-09-14T18:42:15+0000</created_time>

<id>47657117525_10154615411837526</id>

</data>
-<data>

<message>????????????</message>

<story>Golden State Warriors shared Draymond Green's photo.</story>

<created_time>2016-09-14T18:29:31+0000</created_time>

<id>47657117525_10154615388222526</id>

</data>
-<data>

<message>Single game tickets are now available for Warriors Insiders! »    
http://on.nba.com/17O7eLP</message>

<created_time>2016-09-14T17:10:00+0000</created_time>

<id>47657117525_10154613058837526</id>

</data>
-<data>

<message>Signs that training camp is almost here... ????</message>

<story>Golden State Warriors added 2 new photos.</story>

<created_time>2016-09-14T01:41:40+0000</created_time>

<id>47657117525_10154613158592526</id>

</data>

-<paging>
<previous>https://graph.facebook.com/v2.7/47657117525/feed?
access_token.......</previous>
<next>https://graph.facebook.com/v2.7/47657117525/feed?   
 access_token=......</next>
</paging>
</root>

【问题讨论】:

    标签: json xml xml-parsing rss


    【解决方案1】:

    在第二级的每个标记之前以及root 元素之前都有无关的- 字符。

    虽然前者不是问题(可能从验证的角度来看除外),但后者会使文档格式不正确,因为不允许在文档元素之外使用文本。

    【讨论】:

    • 抱歉,可能是错字。当您检查链接时,多余的“-”实际上已经消失了。还有其他建议吗?
    猜你喜欢
    • 2011-10-08
    • 2023-03-24
    • 2021-10-31
    • 2022-01-04
    • 1970-01-01
    • 2019-05-05
    • 2018-11-17
    • 2015-06-30
    • 1970-01-01
    相关资源
    最近更新 更多