Skip to main content
Participant
June 18, 2011
Question

Import excel generated xml

  • June 18, 2011
  • 1 reply
  • 430 views

Hello, i am trying to import to flash an xml file, generated from Excel. I got some tutorials from internet but the format of xml file from excel it's different and i can't manage to access data from it.

if i type trace(xmldata); it shows me the full content of xml file. But how can i acces the correct data if in the xml file it is written:

....

<Row>
    <Cell><Data ss:Type="String">CellName</Data></Cell>
    <Cell><Data ss:Type="Number">CellValue</Data></Cell>....

  

Thank  you  !

This topic has been closed for replies.

1 reply

Inspiring
June 19, 2011

ss is a namespace. You have to declare all namespaces before instantiating XML:

For example:

var xs:String = '<root xmlns:ss="http://www.example.com/uri/"><Row><Cell><Data ss:Type="String">CellName</Data></Cell>2<Cell><Data ss:Type="Number" another="3">CellValue</Data></Cell></Row></root>';
var ss:Namespace = new Namespace("http://www.example.com/uri/");
var xml:XML = new XML(xs);
trace("xml:", xml.Row.Cell.Data.@ss::Type);

You will need to read namespaces that come with Excel generated XML dynamically.

Here is Namspace class documentation:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Namespace.html