I try to read in a .xlsx File in a Flex Application.
Now I try to determine where are my information. Therefore I got the XML Data out of the .xlsx file:
var x:XML = <worksheet mc:Ignorable="x14ac"
xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
<dimension ref="A1:F77"/>
</worksheet>;
Now I like to get the dimensions attribute “ref”. Therefore I use the following code:
var test:Object = x.dimension;
var value:Object = x.dimension.@ref;
Both work perfect if I leave the schema expression at the worksheet. How can I get the correct result with including schemas? Is there a nice way to get the XML without schemas?
Tanks for your help.
It’s because dimension is in the default namespace
xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"So you can simply get the default namespace of you xml and use it like this:
or create it youself and use it the same way:
Here the live test on wonderfl:
http://wonderfl.net/c/7XwU