entius
11-05-2004, 07:35 AM
Firefox 0.9.2 works right, IE 6.0 doesn't.
What i want to do, and that i was doing without major problems was to javascript-interpret xml data island (throwed by a mod_perl module) to display some information.
The source goes well, but i've found some dissapointing problems only in IE. This post is only to see if someone already noticed this and if someone has any idea of what i could do.
The xml data island:
<xml id="kernel_all_user">
<root>
<all_users>
<one_user>
<user_info_name>gerard</user_info_name>
<user_info_pass>gelMBRVXDRhPI</user_info_pass>
<user_info_born>02-11-2004,08:05</user_info_born>
<user_info_aforism_text></user_info_aforism_text>
<user_info_comunity>linux</user_info_comunity>
<user_info_mail></user_info_mail>
<user_info_lastMonth>11</user_info_lastMonth>
<user_info_lastHour>08:05,02</user_info_lastHour>
<user_info_status>1</user_info_status>
<user_info_icone>1</user_info_icone>
<user_registry_histories_sended></user_registry_histories_sended>
<user_registry_histories_published></user_registry_histories_published>
<user_registry_forum_posted></user_registry_forum_posted>
<user_registry_forum_posts></user_registry_forum_posts>
<user_registry_forum_trolls></user_registry_forum_trolls>
<user_info_opinion></user_info_opinion>
<user_info_opinion_date></user_info_opinion_date>
</one_user>
<one_user>
<user_info_name>blogum</user_info_name>
<user_info_pass>blsWDM.jXiu6Y</user_info_pass>
<user_info_born>30-10-2004,00:56</user_info_born>
<user_info_aforism_text></user_info_aforism_text>
<user_info_comunity>gurus</user_info_comunity>
<user_info_mail></user_info_mail>
<user_info_lastMonth>11</user_info_lastMonth>
<user_info_lastHour>07:21,05</user_info_lastHour>
<user_info_status>4</user_info_status>
<user_info_icone>6</user_info_icone>
<user_registry_histories_sended>6</user_registry_histories_sended>
<user_registry_histories_published></user_registry_histories_published>
<user_registry_forum_posted></user_registry_forum_posted>
<user_registry_forum_posts></user_registry_forum_posts>
<user_registry_forum_trolls></user_registry_forum_trolls>
<user_info_opinion></user_info_opinion>
<user_info_opinion_date></user_info_opinion_date>
</one_user>
<one_user>
<user_info_name>moglum</user_info_name>
<user_info_pass>mocHBEy7hoBrI</user_info_pass>
<user_info_born>07-10-103,19:46</user_info_born>
<user_info_aforism_text>moglum</user_info_aforism_text>
<user_info_comunity>moglums</user_info_comunity>
<user_info_mail></user_info_mail>
<user_info_lastMonth>10</user_info_lastMonth>
<user_info_lastHour>19:46,07</user_info_lastHour>
<user_info_status>1</user_info_status>
<user_info_icone>1000</user_info_info_icone>
<user_registry_histories_sended></user_registry_histories_sended>
<user_registry_histories_published></user_registry_histories_published>
<user_registry_forum_posted></user_registry_forum_posted>
<user_registry_forum_posts></user_registry_forum_posts>
<user_registry_forum_trolls></user_registry_forum_trolls>
<user_info_opinion></user_info_opinion>
<user_info_opinion_date></user_info_opinion_date>
</one_user>
</all_users>
</root>
</xml>
First problem with javsacript DOM node-parsing was that in IE i needed a unique parent for all tags.
So the simple xml
<xml><hello><iam>sf</iam></hello></xml>
worked in both navigators, BUT
<xml><hello><iam>sf</iam></hello><ei><howareyou>fine</howareyou></ei></xml>
DON'T.
Indeed, IE says that xml tag has 0 childs.
For this reason i added the
<xml><root>...</root></xml>.
And then IE went right.
But now, i see another problem. You can see the large code of before, well, if i simplify to this it WORK:
<xml id="kernel_all_user">
<root>
<all_users>
<one_user>
<user_info_name>moglum</user_info_name>
<user_info_pass>mocHBEy7hoBrI</user_info_pass>
<user_info_born>07-10-103,19:46</user_info_born>
<user_info_aforism_text>moglum</user_info_aforism_text>
<user_info_comunity>moglums</user_info_comunity>
<user_info_mail></user_info_mail>
<user_info_lastMonth>10</user_info_lastMonth>
<user_info_lastHour>19:46,07</user_info_lastHour>
<user_info_status>1</user_info_status>
<user_info_icone>1000</user_info_info_icone>
<user_registry_histories_sended></user_registry_histories_sended>
<user_registry_histories_published></user_registry_histories_published>
<user_registry_forum_posted></user_registry_forum_posted>
<user_registry_forum_posts></user_registry_forum_posts>
<user_registry_forum_trolls></user_registry_forum_trolls>
<user_info_opinion></user_info_opinion>
<user_info_opinion_date></user_info_opinion_date>
</one_user>
</all_users>
</root>
</xml>
So the problem is with <one_user> repeated tags.
This is awful because if i cannot repeat tags then xml is powerless, and firefox (of course) treats all this stuff as everyone expects.
Any idea???
Here i post my DOM parse-code:
xmlIs = document.getElementById('kernel_all_user').childNodes[0];
for (i=0; i<xmlIs.childNodes.length; i++) {
if (xmlIs.childNodes[i].nodeType == 1) {
for (j=0; j<xmlIs.childNodes[i].childNodes.length; j++) {
if (xmlIs.childNodes[i].childNodes[j].nodeType == 1) {
all_users[all_users.length] = new object();
for (k=0; k<xmlIs.childNodes[i].childNodes[j].childNodes.length; k++) {
if (xmlIs.childNodes[i].childNodes[j].childNodes[k].nodeType == 1) {
var temp;
if (xmlIs.childNodes[i].childNodes[j].childNodes[k].childNodes.length > 0) {
temp = xmlIs.childNodes[i].childNodes[j].childNodes[k].firstChild.nodeValue;
} else {
temp = '';
}
switch(xmlIs.childNodes[i].childNodes[j].nodeName.toLowerCase()) {
case 'one_user':
switch(xmlIs.childNodes[i].childNodes[j].childNodes[k].nodeName.toLowerCase()) {
case 'user_loged': all_users[all_users.length-1].loged = temp; break;
case 'user_hourtoday': all_users[all_users.length-1].hourToday = temp; break;
case 'user_datetoday': all_users[all_users.length-1].dateToday = temp; break;
case 'user_yeartoday': all_users[all_users.length-1].yearToday = temp; break;
case 'user_info_name': all_users[all_users.length-1].name = temp; break;
case 'user_info_born': all_users[all_users.length-1].born = temp; break;
case 'user_info_aforism_text': all_users[all_users.length-1].aforism_text = temp; break;
case 'user_info_comunity': all_users[all_users.length-1].comunity = temp; break;
case 'user_info_mail': all_users[all_users.length-1].mail = temp; break;
case 'user_info_lastmonth': all_users[all_users.length-1].lastMonth = temp; break;
case 'user_info_lasthour': all_users[all_users.length-1].lastHour = temp; break;
case 'user_info_status': all_users[all_users.length-1].status = temp; break;
case 'user_info_icone': all_users[all_users.length-1].icone = temp; break;
case 'user_info_registry_histories_sended': all_users[all_users.length-1].histories_sended = temp; break;
case 'user_info_registry_histories_published': all_users[all_users.length-1].histories_published = temp; break;
case 'user_info_registry_forum_posted': all_users[all_users.length-1].forum_posted = temp; break;
case 'user_registry_forum_posts': all_users[all_users.length-1].forum_posts = temp; break;
case 'user_registry_forum_trolls': all_users[all_users.length-1].forum_trolls = temp; break;
case 'user_info_opinion': all_users[all_users.length-1].opinion = temp; break;
case 'user_info_opinion_date': all_users[all_users.length-1].opinion_date = temp; break;
}
break;
}
}}
}}
}}
What i want to do, and that i was doing without major problems was to javascript-interpret xml data island (throwed by a mod_perl module) to display some information.
The source goes well, but i've found some dissapointing problems only in IE. This post is only to see if someone already noticed this and if someone has any idea of what i could do.
The xml data island:
<xml id="kernel_all_user">
<root>
<all_users>
<one_user>
<user_info_name>gerard</user_info_name>
<user_info_pass>gelMBRVXDRhPI</user_info_pass>
<user_info_born>02-11-2004,08:05</user_info_born>
<user_info_aforism_text></user_info_aforism_text>
<user_info_comunity>linux</user_info_comunity>
<user_info_mail></user_info_mail>
<user_info_lastMonth>11</user_info_lastMonth>
<user_info_lastHour>08:05,02</user_info_lastHour>
<user_info_status>1</user_info_status>
<user_info_icone>1</user_info_icone>
<user_registry_histories_sended></user_registry_histories_sended>
<user_registry_histories_published></user_registry_histories_published>
<user_registry_forum_posted></user_registry_forum_posted>
<user_registry_forum_posts></user_registry_forum_posts>
<user_registry_forum_trolls></user_registry_forum_trolls>
<user_info_opinion></user_info_opinion>
<user_info_opinion_date></user_info_opinion_date>
</one_user>
<one_user>
<user_info_name>blogum</user_info_name>
<user_info_pass>blsWDM.jXiu6Y</user_info_pass>
<user_info_born>30-10-2004,00:56</user_info_born>
<user_info_aforism_text></user_info_aforism_text>
<user_info_comunity>gurus</user_info_comunity>
<user_info_mail></user_info_mail>
<user_info_lastMonth>11</user_info_lastMonth>
<user_info_lastHour>07:21,05</user_info_lastHour>
<user_info_status>4</user_info_status>
<user_info_icone>6</user_info_icone>
<user_registry_histories_sended>6</user_registry_histories_sended>
<user_registry_histories_published></user_registry_histories_published>
<user_registry_forum_posted></user_registry_forum_posted>
<user_registry_forum_posts></user_registry_forum_posts>
<user_registry_forum_trolls></user_registry_forum_trolls>
<user_info_opinion></user_info_opinion>
<user_info_opinion_date></user_info_opinion_date>
</one_user>
<one_user>
<user_info_name>moglum</user_info_name>
<user_info_pass>mocHBEy7hoBrI</user_info_pass>
<user_info_born>07-10-103,19:46</user_info_born>
<user_info_aforism_text>moglum</user_info_aforism_text>
<user_info_comunity>moglums</user_info_comunity>
<user_info_mail></user_info_mail>
<user_info_lastMonth>10</user_info_lastMonth>
<user_info_lastHour>19:46,07</user_info_lastHour>
<user_info_status>1</user_info_status>
<user_info_icone>1000</user_info_info_icone>
<user_registry_histories_sended></user_registry_histories_sended>
<user_registry_histories_published></user_registry_histories_published>
<user_registry_forum_posted></user_registry_forum_posted>
<user_registry_forum_posts></user_registry_forum_posts>
<user_registry_forum_trolls></user_registry_forum_trolls>
<user_info_opinion></user_info_opinion>
<user_info_opinion_date></user_info_opinion_date>
</one_user>
</all_users>
</root>
</xml>
First problem with javsacript DOM node-parsing was that in IE i needed a unique parent for all tags.
So the simple xml
<xml><hello><iam>sf</iam></hello></xml>
worked in both navigators, BUT
<xml><hello><iam>sf</iam></hello><ei><howareyou>fine</howareyou></ei></xml>
DON'T.
Indeed, IE says that xml tag has 0 childs.
For this reason i added the
<xml><root>...</root></xml>.
And then IE went right.
But now, i see another problem. You can see the large code of before, well, if i simplify to this it WORK:
<xml id="kernel_all_user">
<root>
<all_users>
<one_user>
<user_info_name>moglum</user_info_name>
<user_info_pass>mocHBEy7hoBrI</user_info_pass>
<user_info_born>07-10-103,19:46</user_info_born>
<user_info_aforism_text>moglum</user_info_aforism_text>
<user_info_comunity>moglums</user_info_comunity>
<user_info_mail></user_info_mail>
<user_info_lastMonth>10</user_info_lastMonth>
<user_info_lastHour>19:46,07</user_info_lastHour>
<user_info_status>1</user_info_status>
<user_info_icone>1000</user_info_info_icone>
<user_registry_histories_sended></user_registry_histories_sended>
<user_registry_histories_published></user_registry_histories_published>
<user_registry_forum_posted></user_registry_forum_posted>
<user_registry_forum_posts></user_registry_forum_posts>
<user_registry_forum_trolls></user_registry_forum_trolls>
<user_info_opinion></user_info_opinion>
<user_info_opinion_date></user_info_opinion_date>
</one_user>
</all_users>
</root>
</xml>
So the problem is with <one_user> repeated tags.
This is awful because if i cannot repeat tags then xml is powerless, and firefox (of course) treats all this stuff as everyone expects.
Any idea???
Here i post my DOM parse-code:
xmlIs = document.getElementById('kernel_all_user').childNodes[0];
for (i=0; i<xmlIs.childNodes.length; i++) {
if (xmlIs.childNodes[i].nodeType == 1) {
for (j=0; j<xmlIs.childNodes[i].childNodes.length; j++) {
if (xmlIs.childNodes[i].childNodes[j].nodeType == 1) {
all_users[all_users.length] = new object();
for (k=0; k<xmlIs.childNodes[i].childNodes[j].childNodes.length; k++) {
if (xmlIs.childNodes[i].childNodes[j].childNodes[k].nodeType == 1) {
var temp;
if (xmlIs.childNodes[i].childNodes[j].childNodes[k].childNodes.length > 0) {
temp = xmlIs.childNodes[i].childNodes[j].childNodes[k].firstChild.nodeValue;
} else {
temp = '';
}
switch(xmlIs.childNodes[i].childNodes[j].nodeName.toLowerCase()) {
case 'one_user':
switch(xmlIs.childNodes[i].childNodes[j].childNodes[k].nodeName.toLowerCase()) {
case 'user_loged': all_users[all_users.length-1].loged = temp; break;
case 'user_hourtoday': all_users[all_users.length-1].hourToday = temp; break;
case 'user_datetoday': all_users[all_users.length-1].dateToday = temp; break;
case 'user_yeartoday': all_users[all_users.length-1].yearToday = temp; break;
case 'user_info_name': all_users[all_users.length-1].name = temp; break;
case 'user_info_born': all_users[all_users.length-1].born = temp; break;
case 'user_info_aforism_text': all_users[all_users.length-1].aforism_text = temp; break;
case 'user_info_comunity': all_users[all_users.length-1].comunity = temp; break;
case 'user_info_mail': all_users[all_users.length-1].mail = temp; break;
case 'user_info_lastmonth': all_users[all_users.length-1].lastMonth = temp; break;
case 'user_info_lasthour': all_users[all_users.length-1].lastHour = temp; break;
case 'user_info_status': all_users[all_users.length-1].status = temp; break;
case 'user_info_icone': all_users[all_users.length-1].icone = temp; break;
case 'user_info_registry_histories_sended': all_users[all_users.length-1].histories_sended = temp; break;
case 'user_info_registry_histories_published': all_users[all_users.length-1].histories_published = temp; break;
case 'user_info_registry_forum_posted': all_users[all_users.length-1].forum_posted = temp; break;
case 'user_registry_forum_posts': all_users[all_users.length-1].forum_posts = temp; break;
case 'user_registry_forum_trolls': all_users[all_users.length-1].forum_trolls = temp; break;
case 'user_info_opinion': all_users[all_users.length-1].opinion = temp; break;
case 'user_info_opinion_date': all_users[all_users.length-1].opinion_date = temp; break;
}
break;
}
}}
}}
}}