LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-28-2005, 07:45 PM
aura9 aura9 is offline
Registered User
 
Join Date: Apr 2005
Posts: 7
Rep Power: 0
aura9 is on a distinguished road
XML Issue - Text Node Loading as "NULL"

I am having a problem reading the value of a xml text node. It is being read by the Flash XML object as null. Is there something I'm missing?

Here is the XML file
Code:
<?xml version="1.0" standalone="yes"?>
<GALLERY>
	<CATEGORY NAME="brochures">
		<GAL_ITEM NAME="1" FULL="1_full.jpg" THUMB="1_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
		    <DESC>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</DESC>
		</GAL_ITEM>
		<GAL_ITEM NAME="2" FULL="2_full.jpg" THUMB="2_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
			<DESC>
		    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
			</DESC>
		</GAL_ITEM>
		<GAL_ITEM NAME="3" FULL="3_full.jpg" THUMB="3_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
			<DESC>
		    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
			</DESC>
		</GAL_ITEM>
		<GAL_ITEM NAME="4" FULL="4_full.jpg" THUMB="4_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
			<DESC>
		    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
			</DESC>
		</GAL_ITEM>
		<GAL_ITEM NAME="5" FULL="5_full.jpg" THUMB="5_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
			<DESC>
		    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
			</DESC>
		</GAL_ITEM>
		<GAL_ITEM NAME="6" FULL="6_full.jpg" THUMB="6_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
			<DESC>
		    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
			</DESC>
		</GAL_ITEM>
		<GAL_ITEM NAME="7" FULL="7_full.jpg" THUMB="7_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
			<DESC>
		    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
			</DESC>
		</GAL_ITEM>
		<GAL_ITEM NAME="8" FULL="8_full.jpg" THUMB="8_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
			<DESC>
		    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
			</DESC>
		</GAL_ITEM>
		<GAL_ITEM NAME="9" FULL="9_full.jpg" THUMB="9_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
			<DESC>
		    	Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
			</DESC>
		</GAL_ITEM>
	</CATEGORY>
	<CATEGORY NAME="direct mail">
		<GAL_ITEM NAME="1" FULL="1_full.jpg" THUMB="1_thumb.jpg">
			<LINK HREF="http://www.linktofile.com/" TARGET="_blank" NAME="Click Here for enlargement"/>
		    <DESC>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</DESC>
		</GAL_ITEM>
	</CATEGORY>
</GALLERY>
HERE IS THE ActionScript:

Code:
//GetData Object//

GetData = function(file){
	this.file = file; // xml file location
	this.dataObj = new Array();
}
GetData.prototype.load = function(){
	xmlData = new XML;
	xmlData.ignoreWhite = true;	
	xmlData.onLoad = this.parseData;
	xmlData.load(this.file);
	dataObj = this.dataObj;
}
GetData.prototype.parseData = function(){
	rootNode 	= 	xmlData.childNodes;
	galNodes 	= 	rootNode[0].childNodes;
	if(rootNode[0].nodeName.toUpperCase() == "GALLERY"){
		// trace("Found Root Gallery Node! \n\n");trace("Found  "+galNodes.length+" Categories");
		for(var i=0; i < galNodes.length; i++){
			//  GET CATEGORY //
		    	catNodeAtts = galNodes[i].attributes; trace("======================"); trace("Found " + catNodeAtts.NAME);trace("======================");
		    	catNodes  = galNodes[i].childNodes;  //trace("Found  " + catNodes.length + " Items in Category");
			// GET ITEMS //
				for(var ii=0; ii < catNodes.length; ii++){
					// GET ITEM ATTRIBUTES //
		    			itemAtts = catNodes[ii].attributes; trace("Found Full " + itemAtts.FULL);trace("Found Thumb " + itemAtts.THUMB);trace("Found Name " + itemAtts.NAME);
		    			itemNodes = catNodes[ii].childNodes;trace("Found " + itemNodes.length + " Nodes for this Item");
					// GET ITEM NODES //
		    			for(var iii=0; iii < itemNodes.length; iii++){
		    		    	trace(itemNodes[iii].nodeValue);
						}
					trace("---------------------");
				}
		}
	}
}
The Node coming back as Null is the <DESC> from within the <GAL_ITEM> container.

Thanks in advance!

a9
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Loading on Server Problems adam0v Flash CS3 / Flash 9 4 11-19-2008 01:44 PM
Trouble Loading a FLV using XML... JWraith Actionscript 2.0 0 09-11-2008 06:31 PM
loading xml to input text box.. oquindrg XML & Sockets 1 08-01-2006 12:38 PM
Loading data from xml into dynamic text field. jcscoles Newbies 3 05-01-2005 05:47 PM
Creting input textfield denizci2000 Flash MX 5 12-15-2004 08:58 PM




All times are GMT. The time now is 07:11 AM.