I have an XML document that looks like this
<someRoot xmlns:ix="someURL.com">
<ns:InventoryPage Title="something">
<ns:Inventory Id="inventory">
<ns:InventoryView ID="inventoryView">
<Menu>
<ns:GridCreateActionLink Override="true" Visible="false" runat="server"/>
</Menu>
<Columns>
<ns:Column For="IncidentNo" LinkTo="default"/>
<ns:Column DisplayAs="string" For="Location"/>
<ns:Column For="DateaTimeOccur" Format="d"/>
<ns:Column For="Description"/>
<ns:Column For="Workflow.PersonResponsible" displayas="string"/>
<ns:Column For="Workflow.DueDate" Format="d"/>
<ns:Column For="DateClosed" Format="d"/>
<ns:Column DisplayAs="string" For="Workflow.Status"/>
</Columns>
</ns:InventoryView>
</ns:Inventory>
My objective is simple, I am coding with Adobe Flex / AS3 and want to retrieve all the values of the FOR attributes in the column tags and store them in an array.
Assuming the code above is in an XML object called xmlObj, I did the following
var xmlObj:XML = new XML(theXMLAbove);
var someXMLList:XMLList = new XMLList(xmlObj);
This is where I was scratching my head. I tried using e4x to retrieve the values. For example
trace (xmlObj.InventoryPage.Inventory.InventoryView.Columns.column[0].(@For));
or trace (xmlObj.column[0].(@For));
trace (someXMLList:XMLList .InventoryPage.Inventory.InventoryView.Columns.column[0].(@For));
or trace (someXMLList:XMLList .column[0].(@For));
I keep on getting an empty XMLList. or null. Am I going about this all wrong? Would appreciate some help in proceeding. thanks - Edward