You can use native XPath functions to choose data from XML data.
private function choosePartData():void
var items:XMLList = sampleData.item; // get item nodes from XML
var names:XMLList = sampleData.item.@name; // attribute nodes
<item name="1"> value 1</item>
<item name="2"> value 2</item>
For more examples see Flex SDK docs for classes XML and XMLList and http://livedocs.adobe.com/flex/3/html/13_Working_with_XML_01.html
Message was edited by: _Natasha_
Thanks, Natasha. What I was hoping to find was a solution that would not require any pre-processesing on the XML file, but simply render it with the xslt.
I have been successful with the flex-iframe solution (http://code.google.com/p/flex-iframe/), but this requires that the document exists at a URL. I'd like to provide the xml source in memory.
I'm afraid I'm not stating this clearly, which may cause confusion for readers...but I definitely appreciate any responses.
Interesting, but I guess the simple reason is "that's how it's currently done". I don't want to have to parse out each of data elements and roll my own formatting for these documents. The xml files are actually clinical medical documents (CDA formatted) with specific clinical layouts that conform to a variety of health information-related specs.
I do agree that E4X is great for accessing data from XML, but admit that I'm not that familiar with its rendering abilities per xslt. I'll take a look at it. Thanks.
Anyone else have thoughts on this?