Hi Tracy..
Thanks so much, your code got me on the right track. Some slight
modifications gave me exactly what I needed! As for the XML, I must
not have copied/pasted enough info from the full xml file.
Thanks again for your help! You rock!!!
Wayne
-- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:
BTW, you xml is not valid, the closing tag is missing on the End
Plate
node. I fixed it in my example
Tracy
From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Wednesday, June 21, 2006 9:06 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: Building flat data object based on
XML
file with complicated structure
Try this sample app. If I have understood you correctly, it
should do
what you want. The key is the descendants property.
Tracy
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
creationComplete=buildArray()
mx:Script![CDATA[
private function buildArray() :void
{
var aNodes:Array = new Array();
var xmlToProcess:XML = item id=0006 name=ASSY, SPLIT CLUTCH
COVER
item id=0001 name=SPLIT
CLUTCH
COVER
item id=0001
name=CLUTCH COVER MACH.
item
id=0001 name=CLUTCH COVER WELDMENT
item id=0001 name=HR PLATE
item id=0010 name=PLATE(A572-50)/
/item
item id=0002 name=TUBING
item id=0001 name=15X13-1/2 TUBING C1026/
/item
item id=0003 name=PLATE
item id=0010 name=PLATE(A572-50)/
/item
item id=0004 name=END TUBE
item id=0001 name=PLATE(A572-50)/
/item
item id=0005 name=END PLATE
item id=0001 name=PLATE(A572-50)/
/item
/item
/item
/item
/item
var xlConverted:XMLList = xmlToProcess.descendants(*);
trace (xlConverted.length());
var xmlNode:XML;
for (var i:int = 0; i xlConverted.length(); i++) {
xmlNode = xlConverted[i];
trace ([EMAIL PROTECTED]);
aNodes.push(xmlNode);
}
trace(aNodes.length);
}
]]/mx:Script
/mx:Application
From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
Behalf Of wayneposner
Sent: Wednesday, June 21, 2006 7:38 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Building flat data object based on XML
file
with complicated structure
H
Let's try again :)
item id=0006 name=ASSY, SPLIT CLUTCH COVER
item id=0001 name=SPLIT CLUTCH COVER
item id=0001 name=CLUTCH COVER MACH.
item id=0001 name=CLUTCH COVER WELDMENT
item id=0001 name=HR PLATE
item id=0010 name=PLATE(A572-50)/
/item
item id=0002 name=TUBING
item id=0001 name=15X13-1/2 TUBING C1026/
/item
item id=0003 name=PLATE
item id=0010 name=PLATE(A572-50)/
/item
item id=0004 name=END TUBE
item id=0001 name=PLATE(A572-50)/
/item
item id=0005 name=END PLATE
item id=0001 name=PLATE(A572-50)/
/item
/item
/item
/item
I removed some of the extra attributes to get it to format
correctly. Hopefully this works.
--- In flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
, Tracy Spratt tspratt@
wrote:
Is there anyway to post that xml so it stays formatted? I really
do not
like that part of the new yahoo groups.
Tracy
From: flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
] On
Behalf Of wayneposner
Sent: Wednesday, June 21, 2006 2:44 PM
To: flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
Subject: [flexcoders] Building flat data object based on XML
file with
complicated structure
Howdy all!!
Take the following blurb of XML:
item id=0006 qty=2.000 uom=EA matnr=347565
bismt=DBT347565 name=ASSY, SPLIT CLUTCH COVER hasBom=X
path=pdf/347565.pdf image=pdf/thumbnails/347565.jpg
item id=0001 qty=1.000 uom=EA matnr=347564
bismt=DBT347564 name=SPLIT CLUTCH COVER hasBom=X
path=pdf/347564.pdf image=pdf/thumbnails/347564.jpg
item id=0001 qty=1.000 uom=EA matnr=313551
bismt=DBT313551 name=CLUTCH COVER MACH. hasBom=X
path=pdf/313551.pdf image=pdf/thumbnails/313551.jpg
item id=0001 qty=1.000 uom=EA matnr=313552
bismt=DBT313552 name=CLUTCH COVER WELDMENT hasBom=X
path=pdf/313552.pdf image=pdf/thumbnails/313552.jpg
item id=0001 qty=1.000 uom=EA matnr=169902
bismt=J-548F613MK002 name=HR PLATE hasBom=X
path=pdf/169902