Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

XML to be converted to json

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>[email protected]</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>

Fetch Operation in AngularJS

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

The i/p parameter contains the xml, but json object comes null, i have iterated through index, other nodes of xml as well, but no luck. is there any problem with xml structure?

Please help me as i am stuck from 2 days, any help is greatly appreciated

share|improve this question
    
A little more complete example would help a lot. Your data plus one line of code doesn't really get it. How about a ten line code example that gets the data, calls str2json and tries to iterate through the null 'json' variable. A complete example that everyone can run goes a long way to getting good responses. – Daniel Wisehart 9 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.