【发布时间】:2009-07-13 21:23:36
【问题描述】:
我从 AJAX 调用中获取自定义模式数据,我需要使用 jQuery 对其进行解析。知道怎么做吗?
这是 XML:
<xsd:get_customer_summary_response xmlns:xsd="http://com/acmeco/ovm/cas/xsd">
<xsd:customer_details>
<typ:phone_number xmlns:typ="http://com/acmeco/ovm/cas/types">1.555.5553002</typ:phone_number>
<typ:timezone xsi:nil="true" xmlns:typ="http://com/acmeco/ovm/cas/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<typ:zipcode xmlns:typ="http://com/acmeco/ovm/cas/types">3002</typ:zipcode>
...
</xsd:customer_details>
</xsd:get_customer_summary_response>
这里是 AJAX 调用。我可以使用以下内容解析普通 XML,但不能解析 XSD 内容。
$.ajax({
type: "GET",
url: "so.xml",
dataType: "html",
success: function(returnhtml){
$("customer_details", returnhtml).find("zipcode").each(function() {
alert($(this).text());
});
}, etc.
有什么想法吗?
【问题讨论】:
标签: javascript jquery xsd