Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to load all attribute value from xml
    primarykey
    data
    text
    <p>This is my <strong>arty.xml</strong>:</p> <pre><code>&lt;child_2 entity_id="2" value="Root" parent_id="1"&gt; &lt;child_4 entity_id="4" value="Activities" parent_id="2"&gt; &lt;child_10066 entity_id="10066" value="Physical1" parent_id="4"&gt; &lt;child_10067 entity_id="10067" value="Cricket" parent_id="10066"&gt; &lt;child_10068 entity_id="10068" value="One Day" parent_id="10067"/&gt; &lt;/child_10067&gt; &lt;/child_10066&gt; &lt;child_10069 entity_id="10069" value="Test2" parent_id="4"/&gt; &lt;child_10070 entity_id="10070" value="Test3" parent_id="4"/&gt; &lt;child_10071 entity_id="10071" value="Test4" parent_id="4"/&gt; &lt;child_10072 entity_id="10072" value="Test5" parent_id="4"/&gt; &lt;child_5 entity_id="5" value="Physical" parent_id="4"/&gt; &lt;/child_4&gt; &lt;/child_2&gt; </code></pre> <p>This is my attempt to read it:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;link rel="stylesheet" type="text/css" media="all" href="style.css" /&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;title&gt;Using jQuery and XML to populate a drop-down box demo&lt;/title&gt; &lt;script&gt; $(document).ready(function(){ $.ajax({ type: "GET", url: "atry.xml", dataType: "xml", success: function(xml) { var select = $('#mySelect'); $(xml).find('child_2').each(function(){ $(this).find('child_4').each(function(){ var value = $(this).attr('value'); select.append("&lt;option class='ddindent' value='"+ value +"'&gt;"+value+"&lt;/option&gt;"); }); }); select.children(":first").text("Select").attr("selected",true); } //sucess close }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="page-wrap"&gt; &lt;select id="mySelect"&gt; &lt;option&gt;loading&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here I am trying to load all attribute value and create select list...</p> <p>But problem is I am not getting all the child values...</p> <p>Help me out of this...</p>
    singulars
    1. This table or related slice is empty.
    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.
    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