XML Conversion Issue

So, working on calling a Javascript from C#. Got that working, but then suddenly out of nowhere comes an error
within the Javascript I found. It’s an XML parser.

return tSystemData.ToBuiltin(Hashtable);

Error is a conversion from Array to Hashtable, where tSystemData is obviously the array.
Don’t know how this manage to work for the guy who originally made it. >.>

Unity 3.4 has an upgraded javascript engine which is not 100% compatible with previous one. Try importing Boo.Lang and see if it helps. Also, can you copy-paste the error here, so we could really know how to fix it

What would be the syntax of that?

try both

import Boo.Lang
import System.Collections.Hashtable

insert at the top of the script

That didn’t fix it. Well, here’s the code. I’m not to familiar with Javascript, I do everything in C#.

function ParseString (aXMLString : String) : Hashtable[] {
		
		// Initialize the system data array
		var tSystemData : Array = new Array();
		
		// Look for and remove the XML header tag
		aXMLString = RemoveXMLHeaderTag(aXMLString);
		
		// Pull the configuration data
		var tConfigData : Hashtable = GetElementAttributes(aXMLString, "system");
		tSystemData.Push(tConfigData);
		
		// Look for and remove the wrapping system tag
		aXMLString = RemoveSystemTag(aXMLString);
		
		// Process all body tags
		var tNextBody : Hashtable = GetElementAttributes(aXMLString, "body"); //GetNextBody(aXMLString);
		while (tNextBody != null) {
			
			// Add the body to the system data array
			tSystemData.Push(tNextBody);
			
			// Strip the current body tag
			aXMLString = RemoveBodyTag(aXMLString);
			
			// Look for the next body tag
			tNextBody = GetElementAttributes(aXMLString, "body");
			
		}
		
		// Return the system data array as a builtin array
		return tSystemData.ToBuiltin(Hashtable);  // ERROR is here.
		
	}

Actually I dont understand what tSystemData.ToBuiltin(Hashtable) should be doing, so I couldn’t help with that. What is the console output (error message)?

Can’t convert Array to Hashtable[ ] pretty much.

The documentation states that Lists of Lists and Arrays of Arrays are not supported. Since Hashtable derives from Collection my guess is that it falls into that category.

http://www.roguishness.com/unity/

Trying to use that now. But now I’m back to square one of trying to access the script from C#. XP

EDIT: And I switched again! I’ll see how this next one does.
http://www.paultondeur.com/2010/03/23/tutorial-loading-and-parsing-external-xml-and-json-files-with-unity-part-1-xml/

Okay, got it going to a degree. Gonna use this for RSS feed.