0

how to call xml file

Hi!! i tried no of time but why it display nothing i can't understand. please help me.

i think my request to call xml file is wrong.
how to make request to call xml file and then how to parse it?
here is my code for request

createView: function() {
this.controls.backbutton = new KONtx.control.BackButton({
label: "List of Films",
}).appendTo(this);
this.controls.label = new KONtx.element.Text({
styles: {
fontSize: KONtx.utility.scale(24),
vAlign: "center",
hAlign: "center",
color: "#FFFFFF"
},
}).appendTo(this);



var xmlDoc = new new XMLHttpRequest();
xmlDoc.autoRedirect = false;
xmlDoc.open( "GET", "http://www.myweb.com/demo/film/film.xml", true );
xmlDoc.send();

if (xmlDoc.status === 200)
{
this.parent();
this.controls.label.setText(this.persist.foo);
var xml = xmlDoc.responseXML,



oNames = xml.evaluate("//Title"),
oDescriptions = xml.evaluate("//ContentType"),
oLocations = xml.evaluate("//Duration"),
events = [];

for (var i = 0, len = oNames.length; i < len; i++)
{
this.parent();
this.controls.label.setText(this.persist.foo);

}
}


},

please help.. help. i am very confused. Thanks

by
3 Replies
  • Take a look here http://developer.yahoo.net/forum/?showtopic=7286

    You are not correctly hooking your return call function to the request.
    0
  • Thaks a lot.. Thanks you. you know you makes my heart beats normal o.w. i was in very tense.. Thanks.
    0
  • Bear in mind that once you define the handler for the request's onreadystatechange property that the scope of "this" won't refer to the view any longer but to the XMLHttpRequest object.

    And you're newing this twice:
    CODE
    var xmlDoc = new new XMLHttpRequest();


    That shouldn't even work.

    Also, when you post code please wrap it in code tags.

    - Ben
    0

Recent Posts

in Design / Interaction - Yahoo! TV Widgets