Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I get this vaue from XML?
    primarykey
    data
    text
    <p>I have this XML :</p> <pre><code>&lt;meteo_italia&gt; &lt;localita&gt; &lt;id&gt;2861&lt;/id&gt; &lt;nome&gt;Foppolo&lt;/nome&gt; &lt;prov&gt;BG&lt;/prov&gt; &lt;capoluogo&gt;0&lt;/capoluogo&gt; &lt;regione&gt;LOMBARDIA&lt;/regione&gt; &lt;previsione time="2011-10-28T06:00"&gt; &lt;id_tempo&gt;6&lt;/id_tempo&gt; &lt;desc_tempo&gt;temporali isolati&lt;/desc_tempo&gt; &lt;temp&gt;2&lt;/temp&gt; &lt;press&gt;1024.3&lt;/press&gt; &lt;um_rel&gt;78&lt;/um_rel&gt; &lt;zerot&gt;3000 m&lt;/zerot&gt; &lt;qn&gt;ND&lt;/qn&gt; &lt;v_dir&gt;ESE&lt;/v_dir&gt; &lt;v_int&gt;4 nodi&lt;/v_int&gt; &lt;ore_s&gt;3&lt;/ore_s&gt; &lt;prec&gt;0-10mm&lt;/prec&gt; &lt;/previsione&gt; &lt;previsione time="2011-10-28T12:00"&gt; &lt;id_tempo&gt;6&lt;/id_tempo&gt; &lt;desc_tempo&gt;temporali isolati&lt;/desc_tempo&gt; &lt;temp&gt;11&lt;/temp&gt; &lt;press&gt;1024.9&lt;/press&gt; &lt;um_rel&gt;46&lt;/um_rel&gt; &lt;zerot&gt;3550 m&lt;/zerot&gt; &lt;qn&gt;ND&lt;/qn&gt; &lt;v_dir&gt;SSO&lt;/v_dir&gt; &lt;v_int&gt;3 nodi&lt;/v_int&gt; &lt;ore_s&gt;3&lt;/ore_s&gt; &lt;prec&gt;0-10mm&lt;/prec&gt; &lt;/previsione&gt; ... XML continues... </code></pre> <p>and I'd like to extract the value <code>temp</code> from the second node <code>previsione</code> on C#.</p> <p>Tried with :</p> <pre><code>using (var wc = new WebClient()) { m_strFilePath = wc.DownloadString(xmlMeteo); } XmlDocument myXmlDocument = new XmlDocument(); myXmlDocument.LoadXml(m_strFilePath); try { Response.Write("Value : " + myXmlDocument.SelectSingleNode("//previsione[position()=0]//temp").Value); } catch { } </code></pre> <p>but I can't get it.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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