I'm using Flash 8 Pro to parse a Microsoft Excel file saved as XML. Excel 2002 had only the standard XML Declaration line:
<?xml version="1.0"?>
<Workbook ...>...</Workbook>
However, Excel 2003 now has two XML Declaration lines:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook ...><...</Workbook>
Everything works fine if I delete the 2nd XML Declaration line, but I'm hoping to not require this of my users whenever they save a new Excel file as XML. I tried the following code w/out success:
var xmlVal:XML = new XML();
xmlVal.ignoreWhite = true;
xmlVal.load("myFile.xml");
xmlVal.onLoad = function(bSuccess:Boolean):Void {
if (bSuccess) {
var xmlWorkbook:XMLNode = xmlVal.firstChild;
while (xmlWorkbook.nodeName != "Workbook")
xmlWorkbook = xmlWorkbook.nextSibling;
}
}
The problem is that "xmlVal.firstChild" points to "undefined" if the 2nd XML Declaration line exists. Any help would be greatly appreciated...
Thanks ahead of time.
~Nate