Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>EDIT: i forget to metion that I'm using JQuery</p> <p>Here is my point of view:</p> <pre><code>function init(){ $.ajax({ type: "GET", url: "http://localhost/gis/hola.xml", // this should be your XML url dataType: "text", success: parseXml // your own callback function }); } function parseXml(xml){ xml = xml.replace(/\n/g,''); // just to replace carry return var url = 'http://localhost/'+xml; alert(url); } </code></pre> <p>Your xml file is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;RecentTutorials&gt; &lt;Tutorial author="The Reddest"&gt; &lt;Title&gt;Silverlight and the Netflix API&lt;/Title&gt; &lt;/Tutorial&gt; &lt;/RecentTutorials&gt; </code></pre> <p>Then, your <code>url</code> variable should be (remember to convert '/' symbol to its specific ASCII character before sends it (http://www.asciitable.com/)):</p> <pre><code>http://localhost/&lt;?xml version="1.0" encoding="utf-8" ?&gt;&lt;RecentTutorials&gt;&lt;Tutorial author="The Reddest"&gt;&lt;Title&gt;Silverlight and the Netflix API&lt;/Title&gt;&lt;/Tutorial&gt;&lt;/RecentTutorials&gt; </code></pre> <p><code>url</code> now have this value. If you try to show this var on a <code>div</code>:</p> <pre><code>Silverlight and the Netflix API </code></pre> <p>Because your browser doesn't skip <code>&lt;</code> and <code>&gt;</code> symbols.</p> <p>Try to call your function like this:</p> <pre><code>function parseXml(xml){ xml = xml.replace(/\n/g,''); // just to replace carry return cooliris.embed.setFeedContents('XML parsed as string: '+xml) } </code></pre> <p>I hope it helps you. Happy codding!</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