第1行的'status'开始标记与'job-request-id'的结束标记不匹配。第1行,第1171位

时间:2014-01-10 09:58:49

标签: c# asp.net

我收到以下代码行的错误代码。

 XmlDocument xdoc = new XmlDocument();
 xdoc.LoadXml(smsreport.CampaignXML);//catches exception on this line

smsreport.CampaignXML="
    <job-status-report>
        <job-request-id>
            <recipients>
                <recipient>
                    <destination>4122985372
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>8142799046
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>4123893743
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>8142443845
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>4124014618
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>4126546500
                    <status>FAIL
                    <error-message>DLVtst:SubmitSM invalid destination address</error-message>
                <recipient>
                    <destination>4129151665
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>9712229387
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>5708815785
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>8183356585
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>4124775849
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>4124775849
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>7169831368
                    <status>SENT
                    <error-message></error-message>
                <recipient>
                    <destination>2022858850
                    <status>SENT
                    <error-message></error-message>
        </job-request-id>
    </job-status-report>"

我还验证了campaignxml是有效的xml。如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

我重新格式化了您的XML,以便更容易看到它的样子。

您缺少大多数元素的结束标记。