Hi i have some problem with xml parsing. So – i want to read data from some xml tags by data. Can you help me? This is my code.
<data>
<element name="name">Zook</element>
<element name="image">img/icons/01/zook.png</element>
</data>
and jquery
$(this).find("element").each(function(){
var name = $(this).attr("name");
$("#div").html('<span>' + name + '</span>')
});
This sample code will extract the data for you:
You will need to restructure your xml though, as at present element has a dual meaning.
Simplify this so that your data looks like this:
Hope this helps