Note that there are some explanatory texts on larger screens.

plurals
  1. POXML data to array
    primarykey
    data
    text
    <p>Below is the XML data I am getting from a URL. When I view source, here is how it looks:</p> <pre><code>&lt;xml&gt; &lt;beginning&gt; &lt;id&gt;information from rss provider here&lt;/id&gt; &lt;updated&gt;information from rss provider here&lt;/updated&gt; &lt;link rel='alternate' type='text/html' href='tttt' title='alternate'/&gt; &lt;link rel='self' type='application/atom+xml' href='tttt'/&gt; &lt;someschemas&gt; &lt;id&gt;test&lt;/id&gt; &lt;movieid&gt;test&lt;/movieid&gt; &lt;updated&gt;teeeeest&lt;/updated&gt; &lt;types scheme='vals' term='test'/&gt; &lt;title type='html'&gt;test&lt;/title&gt; &lt;summary type='html'&gt;test&lt;/summary&gt; &lt;descriptions type='html'&gt;test&lt;/descriptions&gt; &lt;link rel='alternate' type='text/html' href='tttt' title='alternate'/&gt; &lt;link rel='self' type='application/atom+xml' href='tttt'/&gt; &lt;actor&gt; &lt;name&gt;teest&lt;/name&gt; &lt;phone&gt;test&lt;/phone&gt; &lt;/actor&gt; &lt;/someschemas&gt; &lt;someschemas&gt; &lt;id&gt;test&lt;/id&gt; &lt;movieid&gt;test&lt;/movieid&gt; &lt;updated&gt;teeeeest&lt;/updated&gt; &lt;types scheme='vals' term='test'/&gt; &lt;title type='html'&gt;test&lt;/title&gt; &lt;summary type='html'&gt;test&lt;/summary&gt; &lt;descriptions type='html'&gt;test&lt;/descriptions&gt; &lt;link rel='alternate' type='text/html' href='tttt' title='alternate'/&gt; &lt;link rel='self' type='application/atom+xml' href='tttt'/&gt; &lt;actor&gt; &lt;name&gt;teest&lt;/name&gt; &lt;phone&gt;test&lt;/phone&gt; &lt;/actor&gt; &lt;/someschemas&gt; &lt;someschemas&gt; &lt;id&gt;test&lt;/id&gt; &lt;movieid&gt;test&lt;/movieid&gt; &lt;updated&gt;teeeeest&lt;/updated&gt; &lt;types scheme='vals' term='test'/&gt; &lt;title type='html'&gt;test&lt;/title&gt; &lt;summary type='html'&gt;test&lt;/summary&gt; &lt;descriptions type='html'&gt;test&lt;/descriptions&gt; &lt;link rel='alternate' type='text/html' href='tttt' title='alternate'/&gt; &lt;link rel='self' type='application/atom+xml' href='tttt'/&gt; &lt;actor&gt; &lt;name&gt;teest&lt;/name&gt; &lt;phone&gt;test&lt;/phone&gt; &lt;/actor&gt; &lt;/someschemas&gt; &lt;/beginning&gt; &lt;/xml&gt; </code></pre> <p>I am able to read the content in a message box:</p> <pre><code>WebRequest request = WebRequest.Create("http://www.test.com/file.xml"); WebResponse response = request.GetResponse(); Stream dataStream = response.GetResponseStream(); XElement xelement = XElement.Load(dataStream); IEnumerable&lt;XElement&gt; employees = xelement.Elements(); foreach (var employee in employees) { if (employee.Elements("content") != null) { MessageBox.Show(employee.Value.ToString()); } } </code></pre> <p>I would like to save this to an array, or a list, or LINQ. </p> <p>How can i use the code above with the XML above and make it into an array.</p> <p>I only want all the data within <code>&lt;someschemas&gt;.</code> and just these values as key/value pairs:</p> <pre><code>&lt;title type='html'&gt;test&lt;/title&gt; &lt;summary type='html'&gt;test&lt;/summary&gt; &lt;descriptions type='html'&gt;test&lt;/descriptions&gt; &lt;actor&gt; &lt;name&gt;teest&lt;/name&gt; &lt;phone&gt;test&lt;/phone&gt; &lt;/actor&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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