xml_str2json方法在AngularJs中将Null :: Xml返回给Json Conversion

时间:2016-08-30 14:59:00

标签: angularjs json xml

要转换为json的XML

ns1:UnderwritingRequest xmlns:xsd="" xmlns:xsi="" xmlns:ns1="ABCD" ResponseQueueName="">
  <ns1:Header>
    <ns1:TrackingId>ABCDEF</ns1:TrackingId>
    <ns1:PartnerId>Myhome</ns1:PartnerId>
    <ns1:ProductIdentifier>33</ns1:ProductIdentifier>
    <ns1:ProductRollupId>22</ns1:ProductRollupId>
    <ns1:ProductLoanClass>KYC</ns1:ProductLoanClass>
    <ns1:CustomerId>123</ns1:CustomerId>
  </ns1:Header>
  <ns0:Application xmlns:ns0="ABCDE">
    <ns0:SourceId>Web</ns0:SourceId>
    <ns0:ApplicationNumber>3AAA</ns0:ApplicationNumber>
    <ns0:ApplicationUniqueId>3AAA</ns0:ApplicationUniqueId>
    <ns0:SubmitDate>2015-07-15</ns0:SubmitDate>
    <ns0:OriginalDate>2015-07-15</ns0:OriginalDate>
    <ns0:ExpirationDate>2015-07-25</ns0:ExpirationDate>
    <ns0:InitialSubmitDate>2015-07-15</ns0:InitialSubmitDate>
    <ns0:IsApplicationSigned>true</ns0:IsApplicationSigned>
    <ns0:SignedDate>2015-07-15</ns0:SignedDate>
    <ns0:IsApplicationAccepted>true</ns0:IsApplicationAccepted>
    <ns0:AcceptedAmount>0</ns0:AcceptedAmount>
    <ns0:DecisionType>NO</ns0:DecisionType>
    <ns0:IPAddress>1.1.1.1</ns0:IPAddress>
    <ns0:IsAllFaxesReceived>false</ns0:IsAllFaxesReceived>
    <ns0:Contact>
      <ns0:FirstName>Testzqdp</ns0:FirstName>
      <ns0:LastName>Autozqdp</ns0:LastName>
      <ns0:DateOfBirth>1964-02-25</ns0:DateOfBirth>
      <ns0:SSN>15951</ns0:SSN>
      <ns0:DriversLicenseNumber>HASDFASDF</ns0:DriversLicenseNumber>
      <ns0:DriversLicenseState>TX</ns0:DriversLicenseState>
      <ns0:IsActiveMilitary>false</ns0:IsActiveMilitary>
      <ns0:EMailAddress>test449794@email.com</ns0:EMailAddress>
      <ns0:EMailYears>0</ns0:EMailYears>
      <ns0:EMailMonths>0</ns0:EMailMonths>
      <ns0:HomePhone>9727253097</ns0:HomePhone>
      <ns0:CellPho`enter code here`ne>973097</ns0:CellPhone>
    </ns0:Contact>

在AngularJS中获取操作

var json = x2js.xml_str2json(data.XDocResponse[0]);

i / p参数包含xml,但json对象为null,我已遍历索引,xml的其他节点,但没有运气。 xml结构有什么问题吗?

请帮助我,因为我被困2天,非常感谢任何帮助

0 个答案:

没有答案