[英]XML - “Invalid XML Document.”
我正在嘗試更新谷歌聯系人。 當我用下面的xml正文點擊http請求時,我收到錯誤“無效的XML文檔”。
以下是我的XML請求。
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n
<entry>\n
<category scheme=\"https://schemas.google.com/g/2005#kind\" term=\"https://schemas.google.com/contact/2008#contact\"/>\n
<title>test Sun 1:00pm Kinjal S</title>\n
<gd:name>\n
<gd:fullName>test Sun 1:00pm Kinjal S</gd:fullName>\n</gd:name>
<gd:phoneNumber label=\"Mobile\" primary=\"true\">+6598765432</gd:phoneNumber>
<gd:phoneNumber label=\"Father\">+6598732465</gd:phoneNumber>
<gd:phoneNumber label=\"Friend\">+6589898989</gd:phoneNumber>
<gContact:groupMembershipInfo deleted=\"false\" href=\"https://www.google.com/m8/feeds/groups/paresh.tps@gmail.com/base/6\"/>\n
</entry>"
有人可以幫我解決這個問題嗎?
我相信沒有定義2個名稱空間gd
和gContact
。 我剛添加名稱空間,看起來不錯。 這是帶有虛擬命名空間的修改后的XML(請相應地更正),
<?xml version="1.0" encoding="UTF-8"?>
<entry
xmlns:gd = "http://www.w3.org/TR/html4/"
xmlns:gContact = "http://www.w3.org/TR/html4/">
<category scheme="https://schemas.google.com/g/2005#kind" term="https://schemas.google.com/contact/2008#contact"/>
<title>test Sun 1:00pm Kinjal S</title>
<gd:name>
<gd:fullName>test Sun 1:00pm Kinjal S</gd:fullName>
</gd:name>
<gd:phoneNumber label="Mobile" primary="true">+6598765432</gd:phoneNumber>
<gd:phoneNumber label="Father">+6598732465</gd:phoneNumber>
<gd:phoneNumber label="Friend">+6589898989</gd:phoneNumber>
<gContact:groupMembershipInfo deleted="false" href="https://www.google.com/m8/feeds/groups/paresh.tps@gmail.com/base/6"/>
</entry>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.