Fetching Data from XML using jQuery -


currently trying fetch data xml selectbox. xml output ;

<1>     <book_able>0</book_able>     <code>af</code>     <name>afghanistan</name> </1> <2>     <book_able>1</book_able>     <code>al</code>     <name>albanie</name> </2> <3>     <book_able>1</book_able>     <code>dz</code>     <name>algerie</name> </3> <6>     <book_able>1</book_able>     <code>as</code>     <name>samoa americaines</name> </6> <8>     <book_able>1</book_able>     <code>ad</code>     <name>andorre</name> </8> <9>     <book_able>1</book_able>     <code>ao</code>     <name>angola</name> </9> <11>     <book_able>1</book_able>     <code>ai</code>     <name>anguilla</name> </11> 

here numbers denoted order of countries. numbers not correctly ordered. example: after <3> next number <6>. hard fetching using loop. there method this?

you can use jquery.parsexml method process xml documents.

your xml not valid. can't have elements <11>

http://www.w3schools.com/xml/xml_elements.asp

xml naming rules xml elements must follow these naming rules:

names can contain letters, numbers, , other characters names cannot start number or punctuation character names cannot start letters xml (or xml, or xml, etc) names cannot contain spaces name can used, no words reserved.


Comments