Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-27-2008, 04:58 PM   PM User | #1
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
XML parsing error? Repetition

I don't understand but my XML is repeated as I parse it with AJAX. There is a repetition (x2) of nodes:
http://205.205.200.231/~h806209/blog.xml

Code:
		<script type="text/javascript">
			function parseXML(){
				try //Internet Explorer
				{
					xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
				}
				catch(e)
				{
					try //Firefox, Mozilla, Opera, etc.
					{
						xmlDoc=document.implementation.createDocument("","",null);
					}
				catch(e)
					{
						alert(e.message);
						return;
					}
				}
			xmlDoc.async=false;
			xmlDoc.load("blog.xml");
			//document.getElementById("biotext").innerHTML=xmlDoc.getElementsByTagName("blog7708")[0].childNodes[0].nodeValue;
			blogXml= document.getElementById("picbar");
			var m;
			var months = new Array();
			months[0] = "January";
			months[1] = "February";
			months[2] = "March";
			months[3] = "April";
			months[4] = "May";
			months[5] = "June";
			months[6] = "July";
			months[7] = "August";
			months[8] = "September";
			months[9] = "October";
			months[10] = "November";
			months[11] = "December";
			
			for(m=0; m<months.length; m++){
				if(xmlDoc.getElementsByTagName(months[m]).length > 0)
					for(i=0; i<xmlDoc.getElementsByTagName(months[m]).length; i++){
						blogXml.innerHTML+="<span style='font-weight: bold; font-family: Verdana, Arial, Times New Roman; border: 1px solid #BCB2B3; display: block; background-color:#FFFFAE; padding: 5px;'>"+ months[m] + " " + xmlDoc.getElementsByTagName(months[m])[i].getAttribute("date")+ ", " + xmlDoc.getElementsByTagName("year")[0].getAttribute("number")+"</span>";
						blogXml.innerHTML+="<br /><br />";
						blogXml.innerHTML+="<span style='font-weight: normal; font-family: Verdana, Arial, Times New Roman; display: block; padding: 10px;'>" + xmlDoc.getElementsByTagName(months[m])[i].childNodes[0].nodeValue+"</span>";
						blogXml.innerHTML+="<br /><br />";
					} // endfor i
				} // endif
			} // endfor m
			</script>
Code:
<div id="picbar" style="clear: left; margin: 0px 0px 10px 0px; border: none; background-color: #FFCC00; width: 200px; min-height: 390px; overflow-y: scroll;"></div>
__________________
Compare bible texts (and other tools):
TheWheelofGod
gilgalbiblewhee is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:37 PM.


Advertisement
Log in to turn off these ads.