解析XML文档时发生错误

Sks*_*Sks 3 xml coldfusion xml-parsing coldfusion-9

我在服务调用返回XML响应时收到此错误.我无法找到,这个问题已经发生了一段时间.

错误:

An error occured while Parsing an XML document.
The element type "hr" must be terminated by the matching end-tag "</hr>"
Run Code Online (Sandbox Code Playgroud)

(评论更新)

我从IP地址Geolocation XML API获取XML .以下是XML响应.大多数时候,我得到错误是正确的.

XML响应:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <statusCode>OK</statusCode>
  <statusMessage>
  </statusMessage>
  <ipAddress>x.x.x.x</ipAddress>
  <countryCode>US</countryCode>
  <countryName>UNITED STATES</countryName>
  <regionName>NEW YORK</regionName>
  <cityName>NEW YORK CITY</cityName>
  <zipCode>10112</zipCode>
  <latitude>40.7143</latitude>
  <longitude>-72.006</longitude>
  <timeZone>-03:00</timeZone>
</Response>
Run Code Online (Sandbox Code Playgroud)

kjh*_*hes 7

请求被提供给服务或服务本身可能存在问题,并且服务正在返回,而不是预期的良好XML消息,而是包含未终止的水平rule()元素的HTML错误页面hr.检查HTML以获取有关您的请求可能需要执行的操作的线索.请务必考虑服务是否期望您POST到其端点而不是GET.检查Accept标头的介质类型.还要检查身份验证 最后,确保您没有不正确地重复使用缓冲区,以便在服务的正确XML响应之前或之后存在残留的HTML.