that for is ended though. i don't trust any ide unfortunately... :happysad:
try the latest code where i marked the ifs and fors with comments. 
i still get the error. :eek4:
Edit:
ps: i don't believe ur ide is highlighting the error, it is merely showing that section of code is contracted. dreamweaver does the same.
Edit:
okay yay success!!!
i found the bugger, was a for loop that i forgot to take out, it was hidden in the hierarchiel tabbing. here is the updated code, but still got a bit of debugging to do, as it returned the following array:
Code:
.122..pierre du toit;pierre@greywacke.co.za..test subject..Test Attribute 1 = Test Value 1<br />Test Attribute 2 = Test Value 3..test message..1..2010-01-01 19:49:33..1;Test Service 1;20..6;Test Supplier 1;http://www.greywacke.co.za/;Pierre du Toit;Graphic Design & AJAX;pierre@greywacke.co.za;27729154799;800..8;Test Region 7.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
here is the updated function, for some reason i don't seem to be able to find the order tags first and only attribute?:
Code:
// xml parser
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var xmldoc = http_request.responseXML;
//alert(this.responseText);
var order = xmldoc.getElementsByTagName("order");
for (var o = 0; o < order.length; o++) {
var r = 0;
var oarr = new Array();
if (order[o].childNodes.length > 0) {
if (order[o].childNodes.length > 0) {
oarr[r] = order[o].getAttribute("name");
r++;
var leads = order[o].getElementsByTagName("lead");
for (var l = 0; l < leads.length; l++) {
var e = 0
var larr = new Array();
var props = leads[l].childNodes;
//=== BEGIN PROBLEMATIC CODE ==========================
for (var a = 0; a < props.length; a++) {
if (props[a].childNodes.length > 0) {
var t = 0;
var tarr = new Array();
var prop = props[a];
if (prop.childNodes.length > 0) {
if (prop.firstChild.data) {
tarr[t] = prop.firstChild.data;
t++;
}
} else if (prop.tagName == "service") {
var varr = new Array();
for (var v = 0; v < prop.attributes.length; v++) {
varr[v] = prop.attributes[v].value;
}
tarr[t] = varr.join(";");
t++;
} else if (prop.tagName == "supplier") {
var parr = new Array();
for (var p = 0; p < prop.attributes.length; p++) {
parr[p] = prop.attributes[p].value;
}
tarr[t] = parr.join(";");
t++;
} else if (prop.tagName == "region") {
var garr = new Array();
for (var g = 0; g < prop.attributes.length; g++) {
garr[g] = prop.attributes[g].value;
}
tarr[t] = garr.join(";");
t++;
}
larr[e] = tarr.join(".");
e++;
}
}
//=== END PROBLEMATIC CODE ==========================
}
oarr[r] = larr.join("|");
r++;
alert(oarr);
//addorder("list_leads", oarr);
}
}
}
//if (xmldoc.getElementsByTagName("sql")[0]) if (xmldoc.getElementsByTagName("sql")[0].firstChild) var sql = xmldoc.getElementsByTagName("sql")[0].firstChild.data; if (sql != "") alert(sql);
} else {
alert('There was a problem with the request.');
}
document.getElementById("ajaxbg").style.visibility = "hidden";
}
}
okay the function parses all the tags correctly, except for the service, supplier and region tags which have attributes.
this is the array returned by the above code:
Code:
Test Supplier 1,125|test;pierre@greywacke.co.za|test subject|Test Attribute 1 = Test Value 1<br />Test Attribute 2 = Test Value 3|test message|1|2010-01-02 21:13:26
it is however missing the following values being appended:
Code:
|1;Test Service 1|20|6;Test Supplier 1;|http://www.greywacke.co.za/;Pierre du Toit;Graphic Design & AJAX;pierre@greywacke.co.za;27729154799;800|8;Test Region 7
which are the attributes for the service, supplier and region tags. what's wrong thats causing it not to retrieve them? 0o
i've highlighted the problematic section of code, please help before this has to be posted to a new thread!