Note that there are some explanatory texts on larger screens.

plurals
  1. POIssues Reading an XML with jquery
    text
    copied!<p>I am trying to read the following XML into my database on my mobile app. </p> <pre><code> &lt;RESPONSE&gt; &lt;IMAGERY_RESPONSE&gt; &lt;EMBEDDED_FILE _Type="JPEG" _EncodingType="BASE64" _ImageOrientation="Front" _Latitude="10" _Longitude="20"&gt; &lt;DOCUMENT&gt;animagebaseinbase64&lt;/DOCUMENT&gt; &lt;/EMBEDDED_FILE&gt; &lt;EMBEDDED_FILE _Type="JPEG" _EncodingType="BASE64" _ImageOrientation="Side" _Latitude="11" _Longitude="21"&gt; &lt;DOCUMENT&gt;animagebaseinbase64&lt;/DOCUMENT&gt; &lt;/EMBEDDED_FILE&gt; &lt;EMBEDDED_FILE _Type="JPEG" _EncodingType="BASE64" _ImageOrientation="Back" _Latitude="12" _Longitude="22"&gt; &lt;DOCUMENT&gt;animagebaseinbase64&lt;/DOCUMENT&gt; &lt;/EMBEDDED_FILE&gt; &lt;/IMAGERY_RESPONSE&gt; &lt;RESPONSE&gt; </code></pre> <p>The issue I'm having is I only get 1 of the documents(the base64 encoded photo), from what I know the following jQuery function should be working correctly. Please let me know if any of you see anything off or that should be done a different way, I'm kind of new to jQuery.</p> <pre><code> $(xml).find("RESPONSE").each(function () { $(this).find("IMAGERY_RESPONSE").each(function () { $(this).find("EMBEDDED_FILE").each(function () { var long = $(this).attr('_Longitude').valueOf(); var lat = $(this).attr('_Latitude').valueOf(); var ori = $(this).attr('_ImageOrientation').valueOf(); $(this).find("DOCUMENT").each(function () { var docu = $(this).valueOf(); }) photoToDatabase(long, lat, ori ,docu); }) }) }); </code></pre> <p>Thanks for any help. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload