<div dir="ltr"><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif">Arnaud, </font></font></font><div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif"><br></font></font></font></div>

<div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif">I want to implement exactly the same thing in my project. I made a Ajax request same as you with onSuccess function defined in the same JS file. The problem for me is, the function defined for onSuccess event is not recognized and the browser showing an error message saying that the function is not defined. </font></font></font></div>

<div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif"><br></font></font></font></div><div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif">I just don&#39;t know what&#39;s wrong with that function. I have my function defined in the same file but is not recognized on  the request execution. Do you have any experience with this issue or have any ideas on what&#39;s went wrong ??</font></font></font></div>

<div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif"><br></font></font></font></div><div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif">The excerpt from my XML request is as follows </font></font></font></div>

<div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif"><br></font></font></font></div><div><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">searchAddress: function( e ){</font></div>

<div><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">        </font></div><div><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">        </font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">        </font></span><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">var swrequest = new OpenLayers.Ajax.Request( </font></div>

<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">                </font></span><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">&quot;<a href="http://siasporapv01:8080/gss/native?service=locate">http://siasporapv01:8080/gss/native?service=locate</a>&quot;,</font></div>

<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">                </font></span><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">{ method: &quot;GET&quot;, onSuccess: locateServiceResponse, extractAttributes: true }</font></div>

<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">                </font></span><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif"> );</font></div>

<div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">                </font></span><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">OpenLayers.Event.stop(e);</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#333300" face="arial, helvetica, sans-serif">                                </font></span></div>

<div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif"><span class="Apple-tab-span" style="white-space:pre">        </span>}, </font></font></font></div><div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif"><br>

</font></font></font></div><div><font color="#333300"><font size="2"><font face="arial,helvetica,sans-serif"><div>locateServiceResponse: function(){</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>var xmlResponse = new OpenLayers.format.XML();</div>

<div><span class="Apple-tab-span" style="white-space:pre">                </span>console.log( xmlResponse );</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>},</div><div><br></div><div><br></div>
<div>
Any help is appreciated.</div><div><br></div><div><br></div><div>Kalyan Kampealli</div><div><br></div></font></font></font><br><div class="gmail_quote">On Fri, Jul 16, 2010 at 12:56 AM, Arnaud Vandecasteele <span dir="ltr">&lt;<a href="mailto:arnaud.sig@gmail.com">arnaud.sig@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<br>
<br>
I&#39;m trying to get the value of an XML file  from an external server.<br>
Below are the steps I do.<br>
<br>
1/ I download this XML file with a classic Ajax request :<br>
<br>
var getVesselsXML = new OpenLayers.Ajax.Request(<br>
urlVessels,<br>
                                {<br>
                                  method: &#39;get&#39;<br>
                                  ,onSuccess : drawVessels<br>
                                  ,extractAttributes: true<br>
                                }<br>
                        );<br>
<br>
The result of the request is :<br>
<br>
&quot;&lt;POSITIONS&gt;<br>
&lt;V_POS LAT=&quot;42.35675&quot; LON=&quot;4.2338452&quot; N=&quot;RED COUGAR&quot; T=&quot;9&quot; H=&quot;43&quot;<br>
S=&quot;53&quot; F=&quot;ES&quot; M=&quot;225350000&quot; L=&quot;32&quot; E=&quot;5&quot; /&gt;<br>
&lt;V_POS LAT=&quot;42.532299&quot; LON=&quot;4.35115&quot; N=&quot;AQUAGLORY&quot; T=&quot;7&quot; H=&quot;217&quot;<br>
S=&quot;157&quot; F=&quot;GR&quot; M=&quot;240119000&quot; L=&quot;289&quot; E=&quot;2&quot; /&gt;...<br>
&lt;/POSITIONS&gt;&quot;<br>
<br>
2/ In the drawVessels method I parse the result  :<br>
<br>
var XmlFormat = new OpenLayers.Format.XML();<br>
vessels = XmlFormat.read(XmlvesselsRequest.responseText);<br>
<br>
But I don&#39;t know how to get the attributes of a specific node. For<br>
example, how can i Get the LON and the LAT of each node ?<br>
<br>
I already tried somethings like that but it return me an empty string :<br>
<br>
vessel = XmlFormat.getElementsByTagNameNS(vessels,&#39;*&#39;,&#39;V_POS&#39;);<br>
<br>
for (i in vessel){<br>
   var LAT = XmlFormat.getAttributeNS(vessel[i],&#39;*&#39;,&#39;LAT&#39;);<br>
   console.log(LAT);<br>
}<br>
<br>
<br>
<br>
Thanks for your help<br>
<br>
<br>
Best Regards<br>
<br>
Arnaud<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</blockquote></div><br></div></div>