Re: [flexcoders] e4x list of unique child elements.

2006-06-30 Thread Tom Chiverton
On Thursday 29 June 2006 19:38, coder_flex wrote:
 I may be becoming too ambitious here for e4x, nevertheless!

No, both your ways sound fine.

-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.

We are pleased to announce that Halliwells LLP has been voted AIM Lawyer of the 
Year at the 2005 Growth Company Awards



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] e4x list of unique child elements.

2006-06-29 Thread coder_flex
I may be becoming too ambitious here for e4x, nevertheless!
I have an xml structure

var inputXML:XML =
books
book name=da vinci code author=dan brown price=12.22
quantity=2
location city=san francisco state=california/
/book
book name=angels and daemons author=dan brown price=10.20
quantity=4
location city=miami state=florida/
/book
book name=digital fortress author=dan brown price=12.22
quantity=5
location city=los angeles state=california/
/book
/books;

I want two things from above xml document:
1. list of unique state (attribute) names from above xml. ie., list
containing california,florida. 
I can use for each for this but is there a direct e4x expression to do
this.  Is there a better way?
2. merge the book elements from same state into a single element
adding the prices/quantities but ignoring the name, author, city
attributes and return them as xml-list. ie.,
book price=24.44 quantity=7
location state=california/
/book
book price=10.20 quantity=4
location state=florida/
book
The only way I can think of doing this is to create a new xml
structure containing the common attributes by looping through the
original xml. Again, is there a better way?

thanks in advance for the help.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/