Remote XML

I tried to call a feed which is formatted as XML but could not figure out how to use in code. I had to reformat the data as such


ONE


TWO

.

This is not the format remotely…it is something like

<?xml version="1.0" encoding="UTF-8"?> 10 3 true

How can I use this in code to get for example

Thanks

You can add the next line before data loading.

dhx.DataDriver.xml.records="//item";

after that normal xml loading will work

{ view:"list", id:"mylist", url:"alter.xml", datatype:"xml",select:true, template:"#popularity#", select:true, type: { width: "auto" } }

Also, if you need to have a better control other data parsing - custom data driver can be implemeted

docs.dhtmlx.com/touch/doku.php?id=drivers

P.S. Beware that native XML parsing is problematic for Android devices. ( fine for iOS and desctop browsers ) , so JSON is a better format in the common case.

dhtmlx touch still able to process xml on Android devices, but used workaround can fail if you need to have complex xpaths for data location. ( custom xml formats )

Thanks for that info.

I still do not seem to understand how to get this to work. This is the source of the data http:// api.themoviedb.org/2.1/Movie.browse/en-US/xml/bc96c7b4bdd6de03d7e4367b08a6358c?order_by=rating&order=desc&genres=18&min_votes=5&page=2&per_page=10

How can I use what you provided to pick a certain item to populate a list?

Thanks

Check the attached sample.

            dhx.DataDriver.xml.records = "//movie";
			
            dhx.ready(function(){
                dhx.ui({
                    container:"listbox",
    				rows:[
    					{ cols:[	
    						{ view:"list", 
    							id:"mylist", url:"proxy.php", datatype:"xml",select:true,
    							template:"#name# (#type#)", select:true, type: { width: "auto" }
    						}
    					  ] }
    				]
    			});
            });

load_list.ZIP (52.2 KB)

Stanislav - Your solution is brilliant and works perfectly. I actually wrote a php proxy prior to your response that allows cross domain loading of XML which worked though I like your solution its far simpler.

Thank you very much. Your support is on point and immediate.